Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!usc!apple!apple.com!rmh From: rmh@apple.com (Rick Holzgrafe) Newsgroups: comp.sys.mac.misc Subject: Re: What happened in 1904? Message-ID: <9151@goofy.Apple.COM> Date: 16 Jul 90 18:19:07 GMT Sender: usenet@Apple.COM Organization: Apple Computer, Inc. Lines: 42 References:<1990Jul13.131831.26890@ux1.cso.uiuc.edu> <5099@mace.cc.purdue.edu> In article <5099@mace.cc.purdue.edu> omalley@mace.cc.purdue.edu (John O'Malley) writes: > In article <1990Jul13.131831.26890@ux1.cso.uiuc.edu> rolf@sparc1 writes: > > > > You probably have noticed that if your battery gets removed, or the > >PRAM gets zapped that you get some files with dates in 1904. I heard > >a LONG time ago that there was a joke of some sort behind this. > > Anybody know it? > > The year 1900, despite the fact that it is evenly divisible by 4, was > not a leap year. 1904 was a leap year. > > I thought I heard that Apple didn't wanna bother programming in that > exception, so they had the clock start in 1904 instead of 1900. That's probably correct. Figure it this way: the Mac stores the date-and-time as a count of seconds in an unsigned 32-bit integer. That gives you a range of zero to (a little more than) 4 billion seconds. That's a range of (a little more than) 135 years. OK, what years should we cover? How about all of this century, and 35 or 40 years of the next? That should mean that all our users, young and old, can deal with nearly all the dates within their lifetimes. OK then, 1900 - 2035 or so. Then, as John suggested, the programmer speaks up and says "The day-of-the-week calculations get real easy if the first year is a leap year. 1900 wasn't. How about if we start in 1904?" Everyone agrees, and the final range becomes 1904-2040. Well, I have no idea if it was really like that. But I thought this through while writing a calendar-page app recently, and it makes sense. And there's no joke here, unless you think the Julian calendar itself is a bit of a giggle. (Ever checked out September, 1752? I'll bet the programmer was glad he didn't have to cover *that* one! :-) ========================================================================== Rick Holzgrafe | {sun,voder,nsc,mtxinu,dual}!apple!rmh Software Engineer | AppleLink HOLZGRAFE1 rmh@apple.com Apple Computer, Inc. | "All opinions expressed are mine, and do 20525 Mariani Ave. MS: 77-A | not necessarily represent those of my Cupertino, CA 95014 | employer, Apple Computer Inc."