LarsGP 0 Posted March 27, 2022 Hi All In my system Windows treats file timstamps differently depending on the drive concerned: On the permanent, built-in drives (here c:\ and d:\), one hour is added to every file timestamp when we pass from winter to summer, but on any USB-drives this does not happen. Does anybody know if this behavior can be counted on? Regards Lars Share this post Link to post
Uwe Raabe 2057 Posted March 27, 2022 It depends on whether the drive is formatted as NTFS or FAT32. See https://docs.microsoft.com/en-us/windows/win32/sysinfo/file-times 1 Share this post Link to post
LarsGP 0 Posted March 28, 2022 Just discovered a new problem: I checked a few files that were present when we went into summer-time (daylight saving time) recently, and they matched the NTFS-FAT32 explanation. (NTSF-files changed timestamp, FAT32-files did not) I then used Windows to copy a file from a NTSF-disk to a FAT32 disk. The copy ended up having the same time-info as the original, as displayed by windows. I struggle to write code that compensates for both scenatios, and would appriciate advice. Lars Share this post Link to post
Uwe Raabe 2057 Posted March 28, 2022 19 minutes ago, LarsGP said: I struggle to write code that compensates for both scenatios, and would appriciate advice. You simply cannot. If that were possible, the NTFS handling wouldn't have to be implemented in the first place. Share this post Link to post
Pat Foley 51 Posted March 28, 2022 (edited) I seen a scheme where the file is name like this to allow futureorders dir and settledorders dir sorting. Purchaseorder.vendor.20220115.xls Add NTFS partition to flash drive or new drive Edited March 28, 2022 by Pat Foley add format Share this post Link to post
Bill Meyer 337 Posted March 28, 2022 3 hours ago, LarsGP said: Just discovered a new problem: I checked a few files that were present when we went into summer-time (daylight saving time) recently, and they matched the NTFS-FAT32 explanation. (NTSF-files changed timestamp, FAT32-files did not) I then used Windows to copy a file from a NTSF-disk to a FAT32 disk. The copy ended up having the same time-info as the original, as displayed by windows. I struggle to write code that compensates for both scenatios, and would appriciate advice. Lars Not sure whether this helps, but you should familiarize yourself with the behavior in Windows. https://docs.microsoft.com/en-us/windows/win32/sysinfo/file-times Share this post Link to post
Lars Fosdal 1792 Posted March 29, 2022 I´m still annoyed with the fact that not even a running Delphi is able to appropriately deal with DST changes while running. "No, all those files didn´t change... the time did." 1 Share this post Link to post
Uwe Raabe 2057 Posted March 29, 2022 2 hours ago, Lars Fosdal said: a running Delphi is able to appropriately deal with DST changes while running. You are working too much... 4 Share this post Link to post
Lars Fosdal 1792 Posted March 29, 2022 I leave the PC and IDE running 24/7 (unless travelling). I do however check in to git before I go have a beer on Friday 🙂 Share this post Link to post