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

JS Date.getTimezoneOffset() always returns zero when using TZ environment variable

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • None
    • 5.12.4
    • Core: Date/Time
    • None
    • Ubuntu 18.04
    • b26ac46c5956e716821e64f291749be110731f16 (qt/qtbase/5.15)

    Description

      With the following minimal example:

      import QtQuick 2.12
      Item {
          Component.onCompleted: console.log("TimezoneOffset:", (new Date()).getTimezoneOffset())
      }

      This shows a correct timezone offset for my system settings:

      $ ~/Qt/5.12.4/gcc_64/bin/qmlscene TimezoneOffsetTest.qml
      qml: TimezoneOffset: 240

      But when run with the timezone set via the TZ environment variable, zero is always returned:

      $ TZ=UTC+10 ~/Qt/5.12.4/gcc_64/bin/qmlscene TimezoneOffsetTest.qml
      qml: TimezoneOffset: 0
      

      Attachments

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

        Activity

          People

            Eddy Edward Welbourne
            nocnokneo Taylor Braun-Jones
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes