[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] 1900-2000 problem.



Angus McIntyre wrote in response to Anders Gardebring:

!At 7:55 pm +0100 18.12.97, Anders Gardebring wrote:
!>Is it possible to ask MacPerl to give 4 figures rather than two when Im asking
!>for the year?
!
!As far as I know, no.

Maybe not on a 32 bit unix, but on a Mac 4 figures will become available from 
the sixth element of perl's time() array by the year 2900.  Many systems are 
moving toward 64 and even 128 bit time ticks nowadays and should steer clear 
of the year 2037 debacle.

<deletia>

!your solution will continue to work just fine. On the other hand, people
!who write code that says:
!
!	$date[5] = "19" + $date[5];
!
!are going to lose big-time.

They've already lost since 97+19 == 116.  Even people who write:

	$year = "19" . $date[5];

will lose big time in 2000.

!Admittedly, Perl's approach is not exactly the way I would have chosen to
!implement a date system, but at least it isn't really locking you into a
!two-digit year representation.
!
!I believe that farmers have a maxim that says "Live as if you were going to
!die tomorrow. Farm as if you were going to live forever." The analogous
!maxim for our profession might be "Live as if you were going to die
!tomorrow; write code as if you were going to have to maintain it forever."
!Larry Wall stands a good chance of being alive on Jan 1st 2000, on which
!date all the weenies who didn't read the Camel Book carefully enough will
!see their systems go pear-shaped. And all I can say is, serves him right
!when his mailbox fills with angry messages.
!
!Of course, this raises the vexed question of what a sensible dating system
!would be. Even if you allocate a sufficient number of digits to take us up
!to, say, the year 999999 or so (it may be short-sighted of me, but I think
!we can worry about the Y1M problem when the time comes), you still have to
!choose the base date, the Year Zero. The supposed date of birth of
!Yeshua-ben-Miriam is boring; *everybody* uses that. In the absence of a
!better candidate, I suggest that we date things from the Hejira. If you're
!still fixated on the Christian calendar, just add 622.
!
!	Angus "After all, there are any number of
!	       camels in the Koran, so it's almost
!	       a Perl book in its own right." McIntyre

Do none of the CPAN date modules handle these?

Peter Prymmer


***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch