Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. What time zone do I initialize QDateTime in?
Qt 6.11 is out! See what's new in the release blog

What time zone do I initialize QDateTime in?

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 1.5k Views 1 Watching
  • 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.
  • T Offline
    T Offline
    tahayassen
    wrote on last edited by
    #1

    I need my Qt application to run a task on all international computers at the same instant regardless of time zone. The application downloads the required date + time from the web in UTC. What time zone must I initialize QDateTime with? UTC? Or does it depend on the local time zone?

    For example:

    Say the required date + time is: 4/22/2013 at 14:00 UTC

    How would I initialize this for a computer that is configured with EST and another computer that is configured with PST?

    Would doing:

    @QDateTime test(QDate(2013, 22, 4), QTime(14, 0, 0));@

    mean that all international computers will run the task at the same time?

    Answered here: http://stackoverflow.com/questions/16138068/what-time-zone-do-i-initialize-qdatetime-in

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved