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

QDateTIme doesn't convert dates correctly to some timezones.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.5.1
    • 5.4.2
    • Core: Date/Time
    • None
    • Qt 4.5.2
      tzdata 2015e
      Archlinux
    • 5c67ce5d6da11b8c4e445bba2a3ffb7b6e7f45d9

    Description

      QdateTime fails to convert dates to some timezones with partial hour like `-4:30` and `-9:30`. This bug currently affects conversions with the `America/Caracas` and `Pacific/Marquesas` timezone but could affect others in the future.

      The function parsePosixOffset from qtimezoneprivate_tz.cpp fails to generate a valid offset for timerules like `4:30`.

      I am attaching a testcase that reproduce this bug (using the datetime source files from the 4.5.2 tarball) and a compile flag that uses the fixed function.

      I am also attaching a patch that fixes the bug (applied to the 5.4.2 Qt tarball).

      To compile/run the testcase:

      qmake
      make
      ./timezone
      

      To compile/run the fixed testcase:

      qmake CONFIG+="TIMEZONE_FIX"
      make
      ./timezone
      

      Related bug reports:
      https://bugs.kde.org/show_bug.cgi?id=343610
      https://bugreports.qt.io/browse/QTBUG-44614

      Attachments

        1. minimal.tar.bz2
          0.5 kB
        2. qt-timezone-offset-parse-fix.patch
          1 kB
        3. testcase.tar.bz2
          1 kB
        4. timezone.tar.bz2
          63 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            thiago Thiago Macieira
            cesarg9 Cesar Garcia
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes