Re: Time::Local let me faint



Jeff Pang wrote:
So if you want to translate 31 August 2006 you have to subtract one from the
month and 1900 from the year:

$ perl -Mstrict -MTime::Local -le 'print timelocal(0,0,0,31,7,106)'
1157007600

John,

For the instance described by you,both '2006' and '106' are right.

$ perl -Mstrict -MTime::Local -le 'print timelocal(0,0,0,31,7,106)'
1156953600
$ perl -Mstrict -MTime::Local -le 'print timelocal(0,0,0,31,7,2006)'
1156953600

The reason that '2006' works is because Time::Local makes a guess that '2006'
actually means '106'.


John
--
use Perl;
program
fulfillment
.



Relevant Pages