Joined: 20 Jun 2005
|Posted: Thu May 03, 2012 5:53 am Post subject: 1 hour date/time diff since TC8 in Windows 7
|Using TC 8 on Windows 7 i recently noticed a strange date/time behavior.
I have a FS-Plugin, where i return virtual files with a special Date to TC in the FindFirst/FindNext loop.
In practice i build a virtual file list with german holidays.
1.Christmas-Day 25.12.2012 0:00
2.Christmas-Day 26.12.2012 0:00
Since TC8 on Windows 7 i see a Date/Time with 1 hour less than expected.
This occurs only for Date/Time outside the DST (Daylight Saving Time)
The result is now 24.12.2012 23:00 for the 1.Christmas-Day and the same 1 hour difference with the 2.Christmas-Day.
Searching the forum pointed me to the new configuration "NewTimeZoneMethod",
which defaults to 1 for Windows 7, and defaults to 0 for Vista (because on Vista i cannot reproduce the problem, if the setting is missing in the ini)
For my special case, this new behavior is wrong.
Of course, i could set NewTimeZoneMethod=0 for myself, but i cannot guarantee it's set for other users of my plugin.
The only workaround i can see is to read the NewTimeZoneMethod from ini and if it is set to 1 then add one hour to the timestamp, if we are in DST (Daylight Saving Time).
Are there any better ways to solve the problem?
Joined: 04 Feb 2003
|Posted: Thu May 03, 2012 6:51 am Post subject:
|This is a difficult question which even Microsoft couldn't resolve - actually different time zone conversion methods would be needed when the timestamp is stored as local time (e.g. FAT32) and when it's stored as UTC (Greenwhich mean time). I do not have a solution to this problem either. Internally, TC stores timestamps as UTC, and converts them to local time only when displaying them in the file lists.
Author of Total Commander