GetFileDate gets time +1 sometime, bug or feature?
GetFileDate gets time +1 sometime, bug or feature?
I am getting this usually on usb disks or net mapped disks.
Registered user of PB (on Linux Mint 21.1 & Win 10 64bit)
- Michael Vogel
- Addict

- Posts: 2821
- Joined: Thu Feb 09, 2006 11:27 pm
- Contact:
Re: GetFileDate gets time +1 sometime, bug or feature?
Windows feature, alternative file commander filter these things when comparing file dates etc.
-
Little John
- Addict

- Posts: 4807
- Joined: Thu Jun 07, 2007 3:25 pm
- Location: Berlin, Germany
Re: GetFileDate gets time +1 sometime, bug or feature?
Your problem might be due to switching between normal time and daylight saving time.
This issue is known for NTFS (not for FAT file systems). On NTFS, the time stamp of a file that was created in summer while there was daylight saving time, is 1 hour wrong during winter -- and vice versa. Just copy a file after creation on NTFS in summer to another drive which has a FAT file system ... and compare their time stamps in winter.
Regards, Little John
This issue is known for NTFS (not for FAT file systems). On NTFS, the time stamp of a file that was created in summer while there was daylight saving time, is 1 hour wrong during winter -- and vice versa. Just copy a file after creation on NTFS in summer to another drive which has a FAT file system ... and compare their time stamps in winter.
Regards, Little John
- Michael Vogel
- Addict

- Posts: 2821
- Joined: Thu Feb 09, 2006 11:27 pm
- Contact:
Re: GetFileDate gets time +1 sometime, bug or feature?
Time+1 means the delta of a second or not?Little John wrote:Your problem might be due to switching between normal time and daylight saving time.
This issue is known for NTFS (not for FAT file systems). On NTFS, the time stamp of a file that was created in summer while there was daylight saving time, is 1 hour wrong during winter -- and vice versa. Just copy a file after creation on NTFS in summer to another drive which has a FAT file system ... and compare their time stamps in winter.
Regards, Little John
-
Little John
- Addict

- Posts: 4807
- Joined: Thu Jun 07, 2007 3:25 pm
- Location: Berlin, Germany
Re: GetFileDate gets time +1 sometime, bug or feature?
Oops ... good question.Michael Vogel wrote:Time+1 means the delta of a second or not?
I don't know why I assumed that he means a difference of 1 hour.
Regards, Little John
-
gnozal
- PureBasic Expert

- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
Re: GetFileDate gets time +1 sometime, bug or feature?
USB drives are usually formatted in FAT16 or FAT32.
File time stamps on FAT drives are rounded to the nearest two seconds (even number). The file time stamps on NTFS drives are rounded to the nearest 100 nanoseconds.
Consequently, file time stamps on FAT drives always end with an even number of seconds, while file time stamps on NTFS drives can end with either even or odd number of seconds : this may explain the 1 second difference.
File time stamps on FAT drives are rounded to the nearest two seconds (even number). The file time stamps on NTFS drives are rounded to the nearest 100 nanoseconds.
Consequently, file time stamps on FAT drives always end with an even number of seconds, while file time stamps on NTFS drives can end with either even or odd number of seconds : this may explain the 1 second difference.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
