[SATLUG] Epoch trivia question

Bruce Dubbs satlug@satlug.org
Fri May 31 16:16:01 2002


infinitemike@softhome.net wrote:

> Satlugers,
> Today, I was faced with working with some binary files saved on a 
> Macintosh. I'd transferred the files to my Linux box and I wasn't 
> having much problem reading and processing the bits and bytes.  I 
> reached a point in the file where a couple of dates were recorded.  
> These dates were encoded as seconds past the epoch.  Unlike UNIX based 
> systems whose epoch is midnight Jan 1, 1970, Macs use midnight Jan 1, 
> 1904 as their epoch.
> I calculated the seconds between the epochs and adjusted those dates 
> to reference the 1970 epoch and continued on with my work.  This 
> activity raised an interesting trivia question and I was curious if 
> anyone here knows the answer.  Why did Apple choose to make midnight 
> Jan 1, 1904 the beginning of the epoch?
> The UNIX epoch of midnight Jan 1, 1970 makes sense... but 1904?  That 
> seems to be a very odd year to choose as your epoch?  Several of us 
> here at work have gotten to talking about this and none of us can 
> figure out why Apple selected 1904.  Anyone out there know the origins 
> of this little bit of trivia? 

Don't know for sure but I can make a guess.  1900 was not a leap year.

An interesting note is the MS now uses 1 Jan 1600.  The Gregorian 
calendar started in 1582.  MS uses 64 bit times now and measures in 100 
nanosecond units from the epoch.  I did a calculation and the time 
shouldn't roll over until the year 100,000 or so.

  -- Bruce