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.

@d01.02.03 @456 Beat Time is 2003-02-01T09:56:38 Gregorian. @d04.05.06 @123 Beat Time is 2006-05-04T01:57:07 Gregorian. @d04.05.06 @085 Beat Time is 2006-05-04T01:02:24 Gregorian.
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.

use Date::Japanese::Era; my $era = Date::Japanese::Era->new(2006, 4, 5); print "2006 is " . uc($era->name_ascii) . " " . $era->year . "\n"; for my $Emperor (qw(heisei taishou meiji)) { $era = Date::Japanese::Era->new($Emperor, 6); print uc($Emperor) . " 6 is " . $era->gregorian_year . "\n"; } 2006 is HEISEI 18 HEISEI 6 is 1994 TAISHOU 6 is 1917 MEIJI 6 is 1873

Back to Audrey's Locale::Hebrew::Calendar which proved bendable, regardless of the 5000+ year difference in dates!
use Locale::Hebrew::Calendar; my ($dd,$mm,$yy) = ("04","05","-1806"); # Gregorian to Jewish my ($d, $m, $y) = Locale::Hebrew::Calendar::g2j($dd, $mm, $yy); print "G2J: $d/$m/$y\n"; $perl hebrewcal.pl G2J: 11/7/1954

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 reply to Re: The Perl Review's Date Format Challenge by mattr
in thread The Perl Review's Date Format Challenge by brian_d_foy

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.