Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-25624

QML DatePickerDialog Element documentation example does not work properly while Daylight Saving time taken into account

    XMLWordPrintable

Details

    Description

      The QML DatePickerDialog example documented in http://doc.qt.nokia.com/qt-components-symbian/qml-datepickerdialog.html does not work properly in case of time zones where DST taken into account. The reason of this problem is JavaScript's Date() function, which does not take care of Daylight Time Saving, resulting erroneous result in those regions where DST is maintained.
      So, A specific date picked from QML's DatePickerDialog might give wrong value while fed to JScript Date. QDateTime can be used for both date and time which is according to DST. Here this takes care of Daylight Saving Time from the system, unlike JavaScript and shows proper value.

      Steps to reproduce the problem:

      1. Set the timezone of the device as Brasilia, Brazil(GMT+3).
      2. Pick a date from date picker dialog as 20th March 2012.
      3. JScript's Date() will display 19th March 2012, whereas QDateTime will fetch 20th March 2012.

      Workaround:

      Workaround for this problem is using Qt's QDateTime to get the date/time data instead of JScript's Date().

      The attached sample application shows how to use DatePickerDialog item and QDateTime object together to fetch proper date and time even in the time zones where DST is maintained.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            Unassigned Unassigned
            kusumk Kusuma Kumari Paidi
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes