file datetime reverting to UNIX epoch

I have some old photos that I scanned in and set the file date time via the touch command to a date prior to UNIX epoch (Jan 1 1970). This works, but only for a period of time, when the file reverts back to the UNIX epoch. From what I understand, HFS+ supports date ranges of Jan 1, 1904 - February 6, 2040, and touch doesn't complain using the date, so I'm surprised by the behavior.


Here's an example:


$ touch -t 194310010000 testfile

$ ls -l testfile

-rw-r--r-- 1 bnixon staff 0 Oct 1 1943 testfile


after some period of time (I haven't been able to determine a pattern)


$ ls -l testfile

-rw-r--r-- 1 bnixon staff 0 Dec 31 1969 testfile

Note that I am in the Central time zone, so Dec 31 1969 makes sense once the timezone is applied to the UTC date/time of Jan 1 1970 00:00:00.


Any thoughts on what could be causing this and ways to prevent it? Or, are date time prior to UNIX epoch not supported? I have run First Aid on the drive, and there are no errors.

Mac mini (Late 2012), OS X El Capitan (10.11.1)

Posted on Mar 22, 2016 7:38 PM

Reply
1 reply

Mar 23, 2016 5:36 AM in response to bnixon67

OS X is a UNIX 2003 certified operating system, and UNIX systems abhor bogus file dates prior to the EPOCH of UNIX itself. Consequently, the operating system is saying it doesn't understand your imposed file date, and resets it to the EPOCH, the first valid date in UNIX.


You will have to either organize your photos in dated folder names (e.g. 1943), incorporate the photo date in your filename, or as a Finder Comment via Get Info, whenever the date is outside the valid UNIX data range. You can then tell the Finder, for instance, to show you all images from 1943, where that date is in the folder name, filename, or comments.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

file datetime reverting to UNIX epoch

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.