Why does the clock on my Macintosh reset to 1969?
February 7, 2004 2:36 PM   Subscribe

Macintosh timekeeping: In some occasions, Mac clocks will get reset to some date in 1969 (usually December). Regardless of the reason for this (bad CMOS battery, or jumper resets, or whatever), I just want to know: Why that date? I've Googled with lots of different possible search phrases and found nothing. I assume it's something important to somebody at Apple...?
posted by cyrusdogstar to Computers & Internet (8 answers total)
This is due to OS X's UNIX underpinnings. In UNIX systems, the time is internally represented as seconds elapsed since the stroke of midnight, 00:00 GMT, January 1st, 1970. To the nerds, this is known as the "UNIX epoch." If this counter gets reset to zero or somehow becomes negative, it's 1969 all over again as far as your computer knows.

Why 1970? It was probably a convenient number to start from. If you'll read that Wikipedia article, you'll be happy to know that your Mac probably won't be able to tell time past 2038.
posted by zsazsa at 2:53 PM on February 7, 2004

I think it's important to the beginning of Unix, if I am understanding this warning-message explanation correctly...

"This message indicates that the Time Of Day (TOD) clock reads zero, so its time is the beginning of the UNIX epoch: midnight 31 December 1969. On a brand-new system, the manufacturer might have neglected to initialize the system clock. On older systems it is more likely that the rechargeable battery has run out and requires replacement."

More on this Unix epoch thing from wikipedia. I also wonder if it's related to the weird archive date list on this page.
posted by jessamyn at 2:55 PM on February 7, 2004

Well, the UNIX clock begins on January 1, 1970, at midnight GMT. If I recall correctly, Apple time begins on December 31, 1969, at 4 pm PST, which would be their UNIX time for zero.

So, does anyone know why UNIX started time on January 1, 1970?

UNIX was actually implemented in 1969, but it's first "real" use was in 1971. Why that date was chosen is left to the gods, apparently.
posted by calwatch at 3:00 PM on February 7, 2004

in this article ritchie is quoted as saying:

At the time we didn't have tapes and we had a couple of file-systems running and we kept changing the origin of time," he said. "So finally we said, 'Let's pick one thing that's not going to overflow for a while.' 1970 seemed to be as good as any.
posted by andrew cooke at 3:47 PM on February 7, 2004

When the battery that backs up the clock goes dead, the computer - whether firmware or OS - now resets the time on startup. The only difference is what value it gets reset to.

The clock chip in most Macintosh computers just records a number of seconds. By definition, classic Mac OS treated this as the number of seconds since January 1, 1904, at midnight (local time). When the 32-bit clock register fills up at 0xFFFFFFFF, it will be February 6, 2040, at 6:28 AM local time. In 1984, they felt that 136-year period was enough for anyone. Mac OS 7 added 64-bit second counters (in software) in 1991, so any program that wants to look forward can use dates between about 29,000 BCE and 29,000 AD.

They started the arbitrary time period in 1904 because every year in that range that's divisible by 4 is a leap year, and 1900 was not a leap year. They felt that in 1984, they weren't likely to sell too many computers to people who were born before 1904, so software using the OS's time routines could show everyone's birthday.

Since it's just a number of seconds since the date, a reinitialized value of 0x00000000 means the beginning of the range. Starting in the mid-1990s, the engineer who designed the controller changed it to reset to his birthday, August 27, 1956. I suspect the chip's firmware has to stuff some number in the register when it reinitializes instead of leaving it as garbage, and it just stuffs in Ray Montagne's birthday instead of zero.

(Ray Montagne also made Control-Command-Power give hard restarts on Macintosh systems - having done great work on the Apple II systems, he brought the equivalent of "Control-Open Apple-Reset" to his ADB keymicro controller for the Apple IIgs, and later Macintosh work, too. Ray has forgotten more about desktop microcontrollers than everyone reading this ever knew, combined.)

In Mac OS X, or perhaps in recent versions of firmware, the reinitialization value is midnight, December 31, 1969, GMT, with a default time zone value of "Cupertino, CA," where Apple is located. I'm guessing again, but I'd bet a nickel that some Unix software recognizes a 1969.12.31 or 1970.01.01 date as "uninitialized" and takes appropriate action, which makes it a more useful default choice than Ray's birthday or 1904. On the other hand, it would pre-empt software that tried to warn you if it saw a "1904" date, but time marches on.
posted by mdeatherage at 4:04 PM on February 7, 2004 [1 favorite]

Thanks a lot, guys :) I knew about UNIX timestamps--I was a Linux desktop user before I moved (back, from the early/mid 90s) to the Mac a few months ago. However, as some stated, I always thought of the UNIX base time as 1970, not 1969.

And I had forgotten about the older MacOS resetting to 1904! :) So I was assuming that Macs had always reset to 1969 and it was some Apple-specific thing, instead of just being inhereted from the BSD base of OSX.

At any rate, it's good to know that it's due to the simple fact that Apple chose to use their own timezone's version of the 1970-GMT date.
posted by cyrusdogstar at 4:18 PM on February 7, 2004

There's something sweet about all the above. Thanks!
posted by adamgreenfield at 7:48 PM on February 7, 2004

Great info, mdeatherage! Thanks.
posted by anathema at 8:45 PM on February 8, 2004

« Older Conversion of AOL e-mail archives for use with...   |   Blackletter typeface in Windows? Newer »
This thread is closed to new comments.