[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ale] Perl 5 (localtime) - Y2K issue
- Subject: [ale] Perl 5 (localtime) - Y2K issue
- From: oloryn at mindspring.com (Ben Coleman)
- Date: Thu, 02 Sep 1999 18:12:49 -0500
On Thu, 02 Sep 1999 14:40:46 -0400, Russell Enderby wrote:
>I guess the bottom line is if the intention is to get me just the last two digits it
>should be 01. If it is supposed to give me the full date then 2001. But 101 seems a
>bit odd. Maybe I am the only one with this impression.
If you want the full 4-digit date, just add 1900(same as it's always
been). If you want a 2-digit year, you use '(localtime)[5] % 100'.
Note: this behaviour is inherited from the C localtime function. It's
not likely to change unless the definition of the C function changes.
Ben
--
Ben Coleman oloryn at mindspring.com | The attempt to legislatively
http://oloryn.home.mindspring.com/ | micromanage equality results, at
| best, in equal misery for all.