Leap Year Woes in Japan 302
joerg writes, "The Heise-Newsticker says that Japan had several intercalary day-related computer problems like weather stations delivering wrong data.
" Finally! A Y2K bug! The hype was justified! (cough, cough)
Anyone have a birthday today?
Leap Day Was February 24th! You Missed It! (Score:1)
Pirates of Penzance... (Score:1)
(I can't believe no-one else posted this yet.)
Re:Mainframe headaches (Score:1)
Divisible by 4, yes, unless
divisible by 100, then no, unless
divisible by 400, then it is.
So...
1900, no
1904 yes
2000, yes
2004, yes
2100, no
2104, yes
Re:Programming cock-up (Score:1)
--
Mainframe headaches (Score:1)
I have this feeling that in the year 2100, these old eniacs will still be operating, and February that year will have 29 days. :-)
--
It gets worse.... (Score:1)
didn't know about leap years at all! The same problem will happen again in 2004 unless they fix it by then.
Birthdays... (Score:1)
Re:Youngsters born today (Score:1)
Your Working Boy,
Re:The Irony of it (Score:1)
divisible by 100 unless the year is divisible by 1000.
Well..you asked for it *LOL* you're mostly right...but it's except when the year is divisible by 100 UNLESS it's divisible by 400 hence 1700, 1800, and 1900 were all NOT leap years. which would make 1000 NOT a leap year...right?
The reason they changed over to stardates (Score:1)
Two Adars this year (Score:1)
Re:Programming cock-up (Score:1)
isleap = false;
if(year%4 == 0) {
isleap=true;
year%100 == 0 ? isleap=false;
year%1000 == 0 ? isleap=true;
}
That's rather complicated way of expressing it. And it's wrong too, since it's every 400 years, not every 1000 years, that a multiple of 100 is a leap year.
Wouldn't it be easier to just write:
isleap = !(year%4) ^ !(year%100) ^ !(year%400);
--
Re:Proposals... (Score:1)
Definitely not true for the USA. Traditionally speaking, women are never supposed to propose. But traditions are pretty much out the window in this day and age. I'm rather glad that traditions about men and women are being questioned these days...they were really in dire need of change.
Re:Programming cock-up (Score:1)
Fine day to see a musical. (Score:1)
--
Re:Leap2K (Score:1)
--
Leap2K (Score:1)
Mar 1 9:20am.
Birthday (Score:1)
No worse than other Leap Years (Score:1)
but probably had same rate of failures in 1996
and will have in 2004.
Re:I got one... :) (Score:1)
In Opera 3.62 ß6 under Windoze 4.10.1998, it shows the date as 29, That's all - no month, no year.
Re:Well, this is going to screw up again (Score:1)
Not at all. Knowledge of gravity isn't necessary. They simply discovered the year - seasons repeat after about 365 days. This isn't hard to count, and you can measure how high in the sky the sun gets with very primitive instruments, such as a long stick. Or some well-placed stones. The stones are better as they easily last several years. With this they noticed how the year isn't exactly 365 days, so they added leap years to keep the calendar in sync with the seasons.
Re:The Irony of it (Score:1)
Surely:-
A year is a leap year if it is divisible by 4 and the result is a whole number.
Otherwise every year is divisible by any number.
It's freaking amazing (Score:2)
So you end up with code like:
If (2-digit-year) mod 4 = 0 AND (2-digit-year) != 0
then it's a leap year
This code works from 1900 to 1999. But fails in 2000. Considering it was written in the 1980's, isn't that remarkably short-sighted? And these aren't historical dates... they're current rundates!
Re:Birthday(s) Today! (Score:2)
Re:Programming cock-up (Score:2)
isleap = false;
if(year%4 == 0) {
isleap=true;
year%100 == 0 ? isleap=false;
year%1000 == 0 ? isleap=true;
}
The extent to which the rules are well-known are inversely proportional to their frequency. Hence, the 100 year exception is quite well known, the 1000 year exception is less well known.
I'm guessing the programmers here knew the 100 year exception, and programmed it in, but didn't happen to know about the 1000 year exception, and didn't look anything up. Assumptions, always a bugger, expecially with dates.
(c) Slim, 19100
--
Re:The Irony of it (Score:2)
--
Re:In German, translation follows... (Score:2)
7Hi5 7U35D4Y'5 134P D4Y BR0U9H7 50M3 5URPRi5iN9 (0MPU73R PR0B13M5 70 7H3 Hi9H-73(H N47i0N 0F J4P4N. 4((0RDiN9 70 7H3 R3U73R5 N3W5 493N(Y, 1200 47M5 10(473D iN P057 0FFi(35 3XP3Ri3N(3D 134P-D4Y-R31473D PR0B13M5. 1iK3Wi53, 7H3 J4P4N353 W347H3R 0FFi(3 H4D DiFFi(U17i35 Wi7H 10(41 73MP3R47UR3 4ND PR3(iPi747i0N M345UR3M3N75. 4((0RDiN9 70 R3P0R75, 43 5747i0N5 411 0V3R J4P4N H4V3 B33N 7R4N5Mi77iN9 iN(0RR3(7 iNF0RM47i0N 5iN(3 7Hi5 M0RNiN9. 45 34R1Y 45 M0ND4Y 50M3 24-H0UR F0R3(4575 W3R3 PRiN7iN9 Wi7H 3RR0R5: 7H3 '29' iNDi(47iN9 7H3 1457 D4Y 0F 7H3 F0R3(457 B3(4M3 '1'. iN N0R7H3RN J4P4N, 7H3 53i5Mi( 4(7iVi7Y M0Ni70R5 iN 20 R39i0N41 0FFi(35 F4i13D; H0W3V3R, UN1iK3 47 7H3 574R7 0F 7H3 Y34R, 7Hi5 7iM3 7H3R3 W3R3 N0 R3P0R75 0F M41FUN(7i0N5 iN J4P4N'5 NU(134R P0W3R P14N75.
---
"'Is not a quine' is not a quine" is a quine [nmsu.edu].
Assembler to op codes above. (Score:2)
This is what I was trying to do. My 6800 assembler is a little rough so it may not assemble without modifications.
LDD 0, Y
LDX #$0004
IDIV
BNE false
LDD 0, Y
LDX #$0064
IDIV
BNE true
LDD 0,Y
LDX #$0190
IDIV
BNE false
true LDAA 1
BRA exit
false CLRA
exit NOP
Please post any corrections.
Re:The Irony of it (Score:2)
Re:Programming cock-up (Score:2)
Why make things harder on yourself? isleap = (!(year % 4) && (year % 100)) || !(year % 400);
Re:God those programmers were stupid (Score:2)
You save the time and effort, don't ask the user the year, and the user has to make a minor correction once every four years (roughly). Is choice #2 really that ugly?
I have to make a correction to my watch every other month (almost), and I'm perfectly happy with that arrangement...
Computers are a different story, but I trust my timezone files with that. They even get daylight savings time on and off at the right dates and hours (which my watch doesn't do either).
More Details (Score:2)
But, I mentioned teh 24 hour wander of the time fo the equinox. The equinox is used for the calculation of a number of religious holidays - such as easter. With the gregorian clanedar the wander in time is so large that it can't be kept on the one day. But with the Persian calendar, you can keep it on the same day *if* you choose teh correct meridian.
It just happens that this meridian is about 77 degrees west - roughly where washington DC is... but more interestingly - where Britain founded its first colonies. So, the protestant church could have established this new, more accurate, calendar and if there was a suitable settlement at that longitude, claimed that this was the rightful location of the centre of the christian church.
As it happens the first colony was not well equiped to survive (because tehy were in fact a load of astronomers sent to figure out where teh correct longitude was) and disappeared when britain was unable to supply them for a year.
Re:Gregorian Calendar isn't best. (Score:2)
Re:The Irony of it (Score:2)
Nope. 1700. The 400 rule is a recent addition.
Re:The Irony of it (Score:2)
Except that this rule wasn't adopted in 1700 and 1700 *was* a leap year.
Re:Also a Microsoft bug in calculating the leap da (Score:2)
Not all of them, but some are. (Score:2)
That puts a nice DOT in
Embarrasing Sun Java bug (Score:2)
See: http://developer. java.sun.com/developer/bugParade/bugs/4209272.html [sun.com]
Re:leapday huh? (Score:2)
all salaried employees are working for free today
Not exactly. Consider the following two cases:
Since I mentioned the holiday in February, does anyone else feel kinda shortchanged by the fact that from the last week of November to the middle of February there are five legal holidays, but from the second week of July to the end of August there aren't any? (I know I'm drifting dangerously close to offtopic here...).
This is my opinion and my opinion only. Incidentally, IANAL.
Clipper is having a problem too -- sort of (Score:2)
I have noticed that some applications written using Clipper are also having a problem with today's date. The problem appears to be with programs that never got "Y2K fixed" by adding a SET EPOCH command.
Clipper has always handled dates correctly internally and in its data files; the only Y2K issue appears to be in converting a character representation to the internal format. (For example, in the DTOC() function or in a GET.) Apparently, Clipper programs that haven't had SET EPOCH added have still sort of been working this year anyway. If a year 2000 date is generated internally, and you do a GET on that date, it keeps its 2000 year as long as the user doesn't try to edit it. Or at least, it worked until today. Today, we found out (the hard way) that if you have a date of 02/29/2000 (displayed as 02/29/00) and try to get edit it, Clipper thinks it's an invalid date. The solution is to just Y2K-fix your program (using SET EPOCH), as we all should have done a long time ago.
---
Ada Lovelace? Chuck Babbage? (Score:2)
Ada and Chuck, of course! We're still getting the kinks out of their crufty hacks. Talk about legacy code!
---
Proposals... (Score:2)
a) Is this also true in the US of A ?
b) has anyone been fortunate (or unfortunate) enough to ask/ do the asking and
c) what was the reply ?
Incidentally, guys, if you refuse, a further tradition says that you have to buy her some silk gloves as compensation. [Cheap way of getting out of commitment IMHO
Re:Proposals... (Score:2)
[Personal note: I "hinted" to my fiancee that she should propose to me, which she did, via a "Will You Marry Me?" Easter Egg
My watch has a Y2K problem (Score:2)
Good luck to the people born on February 29th who are now considered by computers as non-existant
Re:Birthday? Yeah! (Score:2)
I always wondered what it would be like to have a birthday on the 29th. Like, when would I celebrate it, Feb 28, or Mar 1? See, this is the kind of thing that screwed me up as a kid.
More stories (Score:2)
Doesn't have to be old (Score:2)
I personally know of a multimillion-dollar system that was installed in 1998 and doesn't recognize the leap day today. And this was discovered in September of 1999. Major rush job to clean things up, finished a couple weeks ago, but only the "essentials" are totally recognizing it; anything that isn't date-critical will be displaying 3/1/2000 today AND tomorrow.
So Close (Score:2)
I was born 12:04 AM March 1, 1980. Tomorrow is my 20th birthday. Had I been born 5 minutes earlier, today would be my 5th birthday, a la Kintanon here
Happy birthday, by the way...
Anthony
Re:My watch is not Y2K compliant... (Score:2)
another translation (Score:2)
- correct my translation if you like, I'm German/American but don't claim to be an expert.
Re:The Irony of it (Score:2)
Re:The Irony of it (Score:2)
The modern gregorian calendar was introduced by Pope Gregory XIII in 1582. However, it was only adopted by roman catholic countries in 1582, other countries, including Britain and Russia remained on the Julian calendar.
1600 was a leap year in both the gregorian calendar and in the julian calendar, and 1700 was a leap year in only the julian calendar.
Britain (And it's colonies, including America) adopted the Greogrian calendar in 1752, but other countries switched at other times, eg Egypt in 1875, Russia in 1918 and more recently Turkey in 1927.
So depending on where you are, the last '00 leap year could have been in 1600,1700,1800 or 1900.
Re:Not a Y2K bug, a provocative maintenance bug (Score:2)
In 1988 a bunch of sun's stopped working [ncl.ac.uk], and people who created accounts with ADM (whatever that is) found they couldn't log in [ncl.ac.uk]. A bunch of BBS's Crashed [ncl.ac.uk].
I don't have any URL's, but I recall that in 1984, Primos machines suffered an outage when the backup program attempted to create a tape to expire on 29FEB85.
I'm sure there are many instances before that, but i'm not familiar with them. I'd say that date's have always been a problem in programs, simply because they're so complex, and easy to get wrong.
Re:Programming cock-up (Score:2)
if(year%4 == 0) {
isleap=true;
year%100 == 0 ? isleap=false;
year%400 == 0 ? isleap=true;
}
Though this won't bite you until 2400...
*shrug* Just switch to the Hebrew calendar then. (Score:2)
Of course figuring out when the leap months are is a bit of a pain in the neck--no regular rules like the Gregorian that any idiot (even many programmers) can keep track of.
Or we could scrap the idea of keeping up with seasons and switch to the Islamic calendar. Of course it's a pain in the neck to program--as the start of the month in most Islamic countries is called by some religious dude looking up and seeing the new moon. ("Hey, it looks like the new moon today! I declare today the start of Muharram!")
Hard to program, unless we equip these old guys with a T1...
Birthday! (my friend, that is) (Score:2)
Lots of Y2K bugs, just none spectacular (Score:2)
Phone problems (Score:2)
Re:Birthday? Yeah! (Score:2)
Re:That Wacky Mayan Calendar (Score:2)
--
Re:My Brithday is Today (Score:2)
I was born in Ga.>:) Athens to be specific.
Apparently that was a terrible year for weather, snow storms that winter and drought that summer.
Lots of fun!
Kintanon
Re:Embarrasing Sun Java bug (Score:2)
Just for the record, our database here at work has also crashed hard and won't seem to come back up. Though I can't say if it's related to the date or not.
Kintanon
Re:The Irony of it (Score:2)
Made the mainstream media (Score:2)
Re:The Irony of it (Score:2)
Re:The Irony of it (Score:2)
Re:The Irony of it (Score:2)
Also a Microsoft bug in calculating the leap day! (Score:2)
Run up a copy of Excel 97
Enter the date 28/02/1900 into cell A1
Enter the formula +a1+1 into cell A2
Cell A2 now displays the date 29/02/1900 [an impossible date as 1900 was not a leap year]
It says a lot about M$ that can't code an event that happened 100 years ago!
M$ don't know what is going on in the past.
M$ can't code for the present either.
I suspect their "forward planning department" is fundamentally unsound also.
Re:Open Society (Score:2)
something about experiencing Y2K problems. I didn't see any announcements in the news about Intuit's Y2K problem.
Hope it wasn't anything serious!
So, why the secrecy? Why isn't any one 'fessing up to their Y2K problems? Nobody wants the embarrassment, the shame of knowing they've had these problems exposed to the public.
Well after doing some reading mostly legal problems. When you get a group of people like lawyers together you really start to have a problem quite fast. Suppose that someone depends on Intuit's software in a major way. Now add in the fact that the person is a large company that has very vested interests in said software. That means that Intuit's in the middle of things and needs to act fast. By not telling anyone they are in effect doing what your probably did as kids: break old man Peterson's window just run and hide and dont' fess up.
Re:The Irony of it (Score:2)
Depends which country you're talking about. The calendar was the creation of Pope Gregory XIII in 1582, dropping ten days in October. Catholic countries followed immediately, and Protestant countries by 1700. In Europe, it was only England who had a leap year in 1700. Use of the Gregorian calendar in England (and the colonies) was finally specified by an Act of Parliament in 1751. By then, because of the extra leap year, the correction required 11 days. I believe Russia may not have changed until this century.
My info is from here [rice.edu] and here [nmsu.edu].
My own personal Y2k. (Score:2)
Esperandi
But I have canned food and a generator, so I'll be okay, right?
Programming cock-up (Score:2)
From the Yahoo report here [yahoo.com]:
An agency spokesman said the computer glitch was caused by an old program installed in the system.
It can't have been that old seeing as leap years occur every 4 years IIRC :) Seeing as I don't think that the rules for calculating leap years are particularly complex and probably in any number of libraries this does seem like a particularly shoddy piece of coding.
Re:Programming cock-up (Score:2)
Aaah, Pascal, that brings back happy memories :)
Alternatively, in Python:
isleap = (not year%4 and (year%100 or not year%400) > 0I really can't be arsed to do an x86 assembler version
Java had some "issues" (Score:2)
So does this mean.. (Score:2)
God those programmers were stupid (Score:2)
leapday huh? (Score:2)
Re:My Brithday is Today (Score:3)
Gee, usually people are conceived during massive snowstorms. (Hey, ya gotta do something...;-)
I have a b-day (Score:3)
OTOH -- I have to say that to blow off Y2K issues at this point is a mistake. The mystique of the rollover was a bunch of nonsense -- and we all knew it. But that doesn't mean that there are no real problems. I have seen quite a few screwed up perl scripts, for example. And it really seems to me that, had we done nothing, some bad things could have happened.
I'd wait until a few billing cycles are through before I called the problem over.
--
Re:Programming cock-up (Score:3)
Motorola 6800 (HC11: needs ACCD and IDIV) machine language:
Store the year in the address (two bytes) pointed to by INDEX Y, The result 1-True/0-False is stored in accumulator A. The two bytes pointed to by INDEX X is used as a scratch area. Run time: 166 clock cycles. (not counting final NOP.)
Those IDIVs are expensive at 41 cycles each. Is there a better way to do mod?
In German, translation follows... (Score:3)
Computer breakdowns by intercalary day in Japan
The intercalary day on today's Tuesday, 29 February, caused some
surprising computer disturbances in the Hightech country Japan. As
the press agency Reuters announces, in post offices due to
Jahr-2000-Fehlern, which were released by the intercalary day, 1200
cash machines failed. The Japanese weather service has problems with
the entry of local temperatures and precipitation. According to the
report 43 stations distributed over the country transmit false data
since this morning. Already on Monday some 24-Stunden-Vorhersagen
with an error had been printed out: Instead of " 29. " became " 1. "
as end of the validity period indicated. In north Japan the devices
failed for the display of seismic activities with 20 local offices.
Differently than to the change of year however no breakdowns were
announced in the Japanese nuclear power stations (cp/c't)
Re:Programming cock-up (Score:3)
I really can't be arsed to do an x86 assembler version :)
Will MIPS do? :-)
la t0,year
lw t1,0(t0)
add t5,zero,zero
andi t2,t1,3
bnz t2,1f
addi t5,zero,1
addi t0,zero,100
div t1,t0
mflo t0
bnz t0,1f
addi t0,zero,400
div t1,t0
mflo t0
beqz t0,1f
add t5,zero,zero
1:
la t0,isleap
sw t5,0(t0)
I could give you sparc, M68k or x86 code also, but this will have to do for now...
Gregorian Calendar isn't best. (Score:3)
The funny thing is - the 97/400 calendar is in fact inferior to the 8/33 year cycle of the Persian calendar, but for 'political reasons it wasn't introduced. The persian cycle has 7 leap years spaced by 4 years, and one spaced by 5.
The reason that the Persian Calendar is better is that the 97/100 cycle lets the dae of the equinox wander by about 56 hours. While the Persian calendar lets it wander by only 24....
Anyway - there's a load of fun political wrangles and a plan by Queen Elisabeth I of Britain to use this better calendar as a secret weapon against the catholic church.... fun fun fun...
Re:The Irony of it (Score:3)
Consider yourself corrected.
Leap years occur when the year is divisible by 4, except when the year is divisible by 100, unless the year is also divisible by *400* (not 1,000).
Re:Should Have Went With The Lunar Calendar (Score:3)
The lunar month is approximately 29.53059 days.
I got one... :) (Score:3)
Re:The Irony of it (Score:3)
bissextile year \bye-SEKS-tuhl-YEAR\ (noun)
: a leap year in the Julian or Gregorian calendar
The year 2000 is a bissextile year, but the year 1900 was
not because leap years can only occur in century years that are
divisible by 400.
When Julius Caesar reformed the calendar in 45 BC, he
stipulated that an extra day be added to February every four
years. But the Romans didn't add the extra day at the end of the
month; they inserted it after the 24th day of the month. They
also reckoned days near the end of a month by counting backwards
from the first of the following month rather than forward from
the beginning of the current one. The day we call February 24 is
six days before March 1, so it was known as the sextus, or "sixth
day." When Caesar's extra day was added, it became a "second
sextus" or bissextus (appending the Latin "bis," meaning
"doubled"). English speakers adopted "bissextile" to refer to
that extra day, even though its placement in the modern calendar
makes that term a misnomer.
My Brithday is Today (Score:3)
So today is my 5th birthday. Everyone send me a present!
Kintanon
Re:The Irony of it (Score:3)
Birthday(s) Today! (Score:3)
Born on this day:
1736: Anne Lee , British blacksmith's daughter who emigrated to the USA and founded
the religious group, the American Society of Shakers.
1792: Gioacchino Rossini , Italian composer who wrote 36 operas, including The Italian
Girl in Algiers, William Tell' The Barber of Seville and The Thieving Magpie - and
invented a number of recipes, notably Tournedos Rossini.
1840: John Holland , Irish-American
1896: Ranchhodji Morarji Decal
1920: Actress Michele Morgan
1920: Actor Arthur Franz
1920: Actor James Mitchell
1928: Actor Joss Ackland
1936: Actor Alex Rocco
1936: Former space shuttle astronaut Jack Lousma
1944: Actor Dennis Farina
1944: Actress Phyllis Frelich
1972: Actor Antonio Sabato Junior
The Irony of it (Score:3)
Re:Programming cock-up (Score:3)
Actually, try this bit of code instead :)
isleap = false;if !(year % 4) {
isleap = true;
year % 100 == 0 ? isleap = false;
year % 400 == 0 ? isleap = true;
}
It's a 400 year exception, not a 1000 year exception...
There are more odds to time than you think (Score:3)
Firstly, we need a calendar to identify the seasons. In month X it is summer, in month Y it is winter.
Secondly, a year doesn't last X months, it lasts 365 days, six hours and a bit.
Even an earth day doesn't last 24 hours (oh no it don't) it lasts 23 hours 59 minutes and 58 seconds.
Lastly, they had the leap year wrong a long time. When Christmas started falling in summer, European countries 'invented' the leap year and between 1534 and 1538 all countries in Europe scratched one month, i.e. any date November 1536 does not exist in Holland.
Pensioner celebrates his 21st birthday (Score:3)
A grandfather is set to fulfil a lifetime's ambition by holding his official 21st birthday party - 63 years after handing out the invitations.
Martin Grundy was born on February 29 in the leap year of 1916 and so celebrates a proper birthday every four years.
As a law student in 1937, he held an informal 21st party with a few drinks on February 28 - and told undergraduates to come to the proper party in 2000.
Here's a MUCH better link...in english even... (Score:4)
Not a Y2K bug, a provocative maintenance bug (Score:4)
This particular problem arose from the fact that far few programmers completely understand the leap year rules [mitre.org], and the code that does the calculations is rarely touched, usually for some reason not directly related to leap year calculations, such as Y2K remediation. It is all wound up in the reasons why software maintenance gets expensive in nearly every case. The specs were either never written down to the level of individual functions, or they are out-of-date. Comments are incomplete or misleading. There's no automated regression tests [c2.com] to give assurance that nothing has been broken.
Why should we care about this? This particular instance was probably due either to Y2K work or a latent bug from some programmer who over-applied the century portion of the leap year rules. Once it gets fixed, this code won't need to be touched for ages. First of all, Y2K was just a single instance of a justification for going through bodies of code making huge numbers of small changes. Porting is another one. And any programmer with a bit of experience can name at least one or two others.
Earlier, I provided a link to the description of the Extreme Programming [c2.com] practice of automated unit tests [c2.com]. Doing that might not have caught these bugs before they got loose. Testing generally only catches the bugs you know to look for, and the tests can be wrong too. But I'm lobbying here to try to overcome the natural resistance many programmers feel toward testing. I know I'd certainly rather be writing code. The reason I've started automating it is because I have no such aversion to building tools to take that dull task away from me. Larry Wall pointed out that laziness is a virtue for programmers. Use it.
Birthday? Yeah! (Score:4)
A friend of mine's son was born today! Although his wife went in to labor at 3am yesterday, we encouraged her to hold off for 24 hours to deliver just for the cool birthday.
I don't think she was amused.
StevePerhaps we just don't know (Score:4)
It just so happens that the organisation which I work for had at least 20 Y2K related incidents occur in the first week of 2000 but we have all be told to keep quiet (hence I don't give the organisation name) I can say this: we are one of the largest organisations in the UK and we must have done damn well to keep information about these problems away from the trade press.....
Re:In German, translation follows... (Score:5)
If you call that a translation...
Disclaimer: I'm not a native English speaker (it shows), and I'm not a native German speaker, but I do think my poor translation is easier to understand than the babelfish one.
forget babblefish, it's at the BBC in English (Score:5)
It's intersting to note they did have problems with Y2K (according to the BBC), so this shouldn't have been *too* much of a surprise...