Details
-
Bug
-
Resolution: Done
-
P2: Important
-
4.3.2
-
None
Description
On Windows, when converting from local time to UTC, QDateTime always adds the timezone offset to the current time, without accounting for DST.
Set a Windows computer to use the Eastern Timezone (GMT -05:00), and then set as the date/time November 4, 01:20 AM; the date/time system dialog will display "Eastern Daylight Time". Now, print the values of currentDateTime() and currentDateTime().toUTC():
=> local: Sun Nov 4 01:20:00 2007
=> utc : Sun Nov 4 06:20:00 2007
Since DST is currently on, the correct UTC time should be '05:20:00' and not '06:20:00'. Now set the clock to 2:20 AM; the date/time system dialog will display "Eastern Standard Time". The output will be
=> local: Sun Nov 4 02:20:00 2007
=> utc : Sun Nov 4 07:20:00 2007