Jump to content
LarsGP

Windows Dayligthsaving problem

Recommended Posts

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

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
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
Posted (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 by Pat Foley
add format

Share this post


Link to post
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

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."

  • Sad 1

Share this post


Link to post
2 hours ago, Lars Fosdal said:

a running Delphi is able to appropriately deal with DST changes while running.

You are working too much...

  • Haha 4

Share this post


Link to post

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×