How to manage the FileGetTime & DST problem?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
newbieforever
Posts: 506
Joined: 24 Aug 2016, 03:34

How to manage the FileGetTime & DST problem?

01 Apr 2019, 08:54

Hi!

It's so stupid! Since yesterday one of my important tools doesn't work anymore. The reason: Yesterday we switched to daylight saving time.

In the script the timestamp of files is determined and compared with timestamps stored in a file. The problem: For one file the timestamp 20190305142100 is stored. Also in Windows Explorer this correct Last Modification Time is displayed: 14:21. Two days ago the world was still in order: FileGetTime delivered 20190305142100...as it should be. But since yesterday FileGetTime gives the timestamp 20190305152100 (15:21). Creasy!

What should one do here???
User avatar
sinkfaze
Posts: 616
Joined: 01 Oct 2013, 08:01

Re: How to manage the FileGetTime & DST problem?

01 Apr 2019, 10:21

What locale are you in, exactly? In the US, DST typically starts on the second Sunday in March and ends on the first Sunday in November, it sounds like your rules for DST fall outside of that.
newbieforever
Posts: 506
Joined: 24 Aug 2016, 03:34

Re: How to manage the FileGetTime & DST problem?

01 Apr 2019, 11:58

Thank you, sinkfaze!

Europe/Berlin/Vienna. In our region DST is this year from March 31 to October 27. Windows 10.

...Windows Explorer displays (e.g.) 14:21, file properties says 14:21, but FileGetTime gives 15:21... Why the hell FileGetTime behaves this way? ("Why" not in the sense "how does it come to that?" but in the sense "how dare FileGetTime do that?" ;-) )
newbieforever
Posts: 506
Joined: 24 Aug 2016, 03:34

Re: How to manage the FileGetTime & DST problem?

02 Apr 2019, 04:00

???

Is there another way to get the timestamp of a file (to avoid the use of FileGetTime)?

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot], LAPIII, peter_ahk and 335 guests