VBA function FileDateTime() is off by 1 hour.
Assuming current date is 06/29/2024 (PDT) and timezone is Los Angeles, the following example is correct.
Dim MyStamp
' Assume TESTFILE was last modified on June12, 2024 at 4:35:47 PM.
' Assume English/U.S. locale settings.
MyStamp = FileDateTime("TESTFILE") ' Returns "6/12/24 4:35:47 PM".
However if TESTFILE was created/modified prior to or after Daylight Savings time, "MyStamp" is off by one hour.
Dim MyStamp
' Assume TESTFILE was last modified on February 12, 2024 at 2:15:47 PM.
' Assume English/U.S. locale settings.
MyStamp = FileDateTime("TESTFILE") ' Returns "2/12/24 3:15:47 PM".
So how to correct not knowing if DST was applied at file creation/modification time?
~ Thank you.