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

Invalid Date for One Hour Period on Daylight Savings

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P3: Somewhat important
    • None
    • 5.9.7, 5.12.0
    • Core: Date/Time
    • None

    Description

      When trying to convert from a string to a QDateTime, the returned value ends up being invalid for a span of 1 hour between 2 am and 3 am on daylight savings (March 10th 2019). As illustrated below:

      QDateTime::fromString("2019-03-10 03:00:00", Qt::ISODate); // ok
      QDateTime::fromString("2019-03-10 01:59:59", Qt::ISODate); // ok
      QDateTime::fromString("2019-03-10 02:59:59", Qt::ISODate); // QDateTime(Invalid)
      QDateTime::fromString("2019-03-10 02:00:00", Qt::ISODate); // QDateTime(Invalid)
      

      I am in the Eastern timezone (Canada). I believe there is a difference between US and Canada of when daylight savings actually starts which might be the cause of the issue. Canada appears to start at 3 am but the US starts at 2 amĀ (Eastern Time) - the exact range of time that is invalid.

      Attachments

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

        Activity

          People

            Eddy Edward Welbourne
            skl131313 Mark R
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes