Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    QDateTime timezones

    General and Desktop
    2
    3
    3513
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • D
      dartan last edited by

      There is variable QDateTime dt, time is stored in it in UTC+0. It is necessary to receive value from this variable in some time zone (for example in Russian UTC+4).
      dt.setTimeSpec (Qt:: OffsetFromUTC) - works but in this case time depends by system options. For example if in system options an hour zone not UTC+4, and UTC+2 some, then value will be in UTC+2.
      I has read the qt-documentation but not found answer.

      Manually it is possible to do dt.addSecs (3600*Offset), but i think that there are internal features which allow transfer on winter/summertime.

      1 Reply Last reply Reply Quote 0
      • A
        andre last edited by

        Timezone support will be drastically improved in Qt 5. John Layt is working on this, and his code is already available to look at and play around with.

        Other than that, your post is very hard to read and understand to me. It seems like an automatic translation, and the actual question isn't clear. Might I suggest you try posting in Russian on the Russion forum section?

        1 Reply Last reply Reply Quote 0
        • D
          dartan last edited by

          yes, sorry =) I am realy use an automatic translation, and I am really post original topic on russian section.
          It is very good news about timezones support in 5 version. I think it is necessary feature. Thanks for answer.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post