Syntactic Confectionery Delight | |
PerlMonks |
Re: The Perl Review's Date Format Challengeby mattr (Curate) |
on Apr 05, 2006 at 16:08 UTC ( [id://541422]=note: print w/replies, xml ) | Need Help?? |
Looks like jcoxen already got it but here's my shot at it.
First there's Swatch time (Beat Time) which gives 1000 beats to each day. See Time::Beat or DateTime::Format::IBeat. IBeat has a way to parse dates as well, so one of these must be right.
The answer to the last one is something between @084 and @085. So depending on your opinion, using the Beat calendar gives us alternate dates of Feb. 1, 2003 and May 4, 2006. Well, this seems to depend either on a European vs. American ordering of month and day, or on Swatch's choice of writing the date before the time. But as long as you realize it is the same Swatch (Beat) time all over the world at a given instant, you can rest assured there will be a lot of people who refuse to accept whichever ordering is being used at any given time. Erm. Well, on to the next. I tried Audrey Tang's Locale::Hebrew::Calendar but of course the year is off by thousands, not useful for duplicating a date in a single lifetime.. or is it? (Stay tuned!) On to some interesting modules by Daisuke Maki, who did DateTime::Calendar::Japanese which is a a 19th century calendar. (DateTime::Format::Japanese is the modern one).
The key is to know that in Japan, many people will now read it as a date 12 years ago and not 2006 (which is Heisei 18). People usually write out 2006 I think, whereas the year 6 would be "Heisei 6" (6th year of the reign of the Heisei Emperor). I will not cause bad luck and tell you how someone born 12 years ago can experience that date three times. But I can say that lots of Japanese have experienced the date already three times, thanks to the "greying of Japan". The previous emperor was Emperor Showa, whose reign began in 1925. So Showa 6 was 1931. So anybody over 75 years old (and there are a *lot* of them here) lived through both Showa 6 and Heisei 6, plus 2006 of course. I tried the modern Japanese calendar module but had trouble pasting the Japanese output from a non-Japanese terminal session (maybe it can be done but..) So, Tatsuhiko Miyagawa's Date::Japanese::Era to the rescue.
Back to Audrey's Locale::Hebrew::Calendar which proved bendable, regardless of the 5000+ year difference in dates!
So I finally found a good use for Y2K after all. Realizing that Y2K also means Y3K ad infinitum, all people living in the past present and future can indeed experience 04.05.06 twice. If this meets your approval I'd like Damian's Practices or MJD's new book instead! :)
In Section
Seekers of Perl Wisdom
|
|