Windows FileAccessDate, FileCreateDate, and FileModifyDate wrong century

Started by STL_EXIF, November 12, 2017, 06:41:52 PM

Previous topic - Next topic

STL_EXIF

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

StarGeek

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.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

STL_EXIF

Thanks for confirming my results and finding the "edges" of the anomaly.

Phil Harvey

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
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

STL_EXIF

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?

Phil Harvey

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
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).