ExifTool Forum

ExifTool => Bug Reports / Feature Requests => Topic started by: STL_EXIF on November 12, 2017, 06:41:52 PM

Title: Windows FileAccessDate, FileCreateDate, and FileModifyDate wrong century
Post by: STL_EXIF on November 12, 2017, 06:41:52 PM
I am using Windows 7 and using version 10.65 of ExifTool.

The three commands I ran were:
exiftool -r -csv "E:\" >"E:\Export_tags_BEFORE_change.csv"

exiftool -overwrite_original -csv="E:\Changes.csv" "E:\"

exiftool -r -csv "E:\" >"E:\Export_tags_AFTER_change.csv"

The MAIN problem I encountered is that when trying to update the FileAccessDate, FileCreateDate, and FileModifyDate of the tif files, the results were in the wrong century (i.e 20 and not 19) for some dates.  Example when changing the FileAccessDate, FileCreateDate, and FileModifyDate to 1955:07:07 the results were 2055:07:07.  This problem did not occur when I set the date to 1973 and did not occur when I set the date to 1855.  I have attached the three files referenced above, "Export_tags_BEFORE_change.csv" , "Changes.csv", "Export_tags_AFTER_change.csv".

Additionally I am attaching a comparison XLS sheet that has cell highlighting where I have identified problems with the results from ExifTool.  I will also attach this comparison sheet as a csv file, however the discrepancies are not "highlighted".

Regards,
Eric
Title: Re: Windows FileAccessDate, FileCreateDate, and FileModifyDate wrong century
Post by: StarGeek on November 12, 2017, 07:40:26 PM
At first, I would have said this was a limitation of the underlying filesystem, but after some checking, it looks like Windows NTFS timestamps can be set as early as 1601-01-01 00:00:00 UTC.  And as you point out, the timestamps can be set to an earlier century. 

After some checking, it looks like the error range is between 1900:01:01 00:00:00 and 1967:12:31 23:59:59.  Before that or after that they set fine.  Phil will have to look into this.
Title: Re: Windows FileAccessDate, FileCreateDate, and FileModifyDate wrong century
Post by: STL_EXIF on November 12, 2017, 08:50:10 PM
Thanks for confirming my results and finding the "edges" of the anomaly.
Title: Re: Windows FileAccessDate, FileCreateDate, and FileModifyDate wrong century
Post by: Phil Harvey on November 13, 2017, 07:10:00 AM
Unfortunately this is a bit out of my hands.  ExifTool uses standard Perl date/time routines to do the necessary conversions.  These routines are based on an epoch date of 1970, and the behaviour before that can be funny.

- Phil
Title: Re: Windows FileAccessDate, FileCreateDate, and FileModifyDate wrong century
Post by: STL_EXIF on November 13, 2017, 10:25:52 AM
That is extremely unfortunate.  It may be appropriate to document this behavior in the official ExifTool documentation.  It seems my approach is now going to involve two steps, update the metadata Date/TimeStamps using ExifTool and then use an alternate windows software solution that can update FileAccessDate, FileCreateDate, and FileModifyDate correctly using the metadata Date/TimeStamps that ExifTool updated.  Are you aware of light weight cli or gui windows solution that can update  FileAccessDate, FileCreateDate, and FileModifyDate after ExifTool has done the heavy lifting?
Title: Re: Windows FileAccessDate, FileCreateDate, and FileModifyDate wrong century
Post by: Phil Harvey on November 13, 2017, 10:39:59 AM
I would recommend not trying to set file date/times before 1970 because any such date/time is obviously incorrect -- it is very unlikely that you would have any digital files created before this time.  If you want to set an earlier time you must be using the system date/time for something other than the intended purpose.  Also note that you may have problems with these date/times if the files are transferred to different file systems.

- Phil