Fog Creek Software
Discussion Board




Leap Year Date Problems

Anyone know of any good stories about leap year date problems in software.  I'd be willing to bet that leap years have cause more problems in software than all of Y2K.


Thursday, February 26, 2004

Lotus 123 thought 1900 was a leap year.

For compatibility, Excel had to calculate dates the same way. So Excel also treats 1900 as a leap year.

Visual Basic wanted compatible dates but couldn't bear to be wrong about the leapyearness of 1900, so they set their epoch one day earlier (Dec 31, 1899).

Meaning date calculations across Excel/Visual Basic boundaries are screwed up, but only for January and February 1900.

Joel Spolsky
Fog Creek Software
Friday, February 27, 2004

Also did you know that when is a leap year, there is a leap day in that year, but it's not Feb.29. but Feb.24. as I remember. Strange but true,


Friday, February 27, 2004

I thought the Feb 24th thing was a bit weird so I checked  -  at least in the European Union it *used* to be true.  There's a bit about it on Wikipedia: http://en.wikipedia.org/wiki/Leap_year .  You learn something new every day.

a cynic writes...
Friday, February 27, 2004

Beautiful!

Stephen Jones
Friday, February 27, 2004

And two other posts seemed to have lept in while I was replying to Joel :)

Stephen Jones
Friday, February 27, 2004

"Meaning date calculations across Excel/Visual Basic boundaries are screwed up, but only for January and February 1900."

Actually, if "Day 1" is one day earlier in one product than in another product, that also likely means that the 'date serial' is out by one forever. So be very careful passing dates around.  (And I'll leave all the bad puns to someone else<G>)

Ron Porter
Friday, February 27, 2004

When it comes to Gantt charts used to solve real problems, Leap year comes second only to DST on the pain-in-the-butt scale.

Nigel
Friday, February 27, 2004

Um, am I missing something here? Even if you call Feb 24 your leap day, you still end up with a Feb 29 only in leap years, right?

Dennis Atkins
Friday, February 27, 2004

http://en.wikipedia.org/wiki/Leap_year

Yo
Friday, February 27, 2004

>Even if you call Feb 24 your leap day, you still end up with a Feb 29 only in leap years, right?

Yes but it is the point of it.
You see according to this tradition, if you are born on Feb 24 on a leap year, then you should only celebrate your birthday once every four years.

If you are born on any day after Feb 24 on a leap year, then in any year not a leap year, you would celebrate your birthday one day earlier. ie born on Feb 26 on a leap year, then in normal years you celebrate your birthday on Feb 25, because you were actually born on Feb25, its just that in leap years we renumber all the dates after Feb 24.

Conversely, if you are born on any day Feb 24 or later on a normal year (ie Feb 26), then in a leap year you will be celebrating your birthday one day later (ie Feb 27 on a leap year).

You see our present way of thinking is that if you are born on Feb 29 in a leap year then you only celebrate your birthday on a leap year, but according to the roman way of thinking you would be celebrating your birthday on Feb 28 in normal years.

Aussie Chick
Friday, February 27, 2004

I suspect it had something to do with Saints' days. For some reason a gap between the Saints for the 23rd Feb and 24th Feb was considered less harmful than a gap between the 28th Feb and 1st March would have been.

Stephen Jones
Friday, February 27, 2004

The practice of inserting an extra day after February 23rd (not the 28th) goes back to the ancient Roman tradition of adding intercalary months. Before the calendar reform that gave us the Julian calendar, the lunar calendar was kept in synch with the solar year by the occasional insertion of an extra month (called Intercalaris). By royal decree, this extra month was inserted after the "seventh day before the Kalendae [i.e., the first] of March", which corresponds to our February 24th. Later, when Julius Caesar reformed the calendar, and instituted the practice of an additional day every four years, he decreed the sixth day before the Kalendae of March be doubled. This second sixth day was called bisixtiles.

Lee Kaiwen
Sunday, February 29, 2004

If you had a child born on February 29th, what wll that child birday be after Leap year?

Carolyn Sattiewhite
Monday, March 01, 2004

*  Recent Topics

*  Fog Creek Home