date handle
$ perl -MTime::Local -le 'print timelocal(0,0,0,1,1,1900)'
Cannot handle date (0, 0, 0, 1, 1, 1900) at -e line 1
why Time::Local can't handle the date of 1900?
Thanks.
--
To unsubscribe, e-mail: beginners-unsubscribe [at] perl.org
For additional commands, e-mail: beginners-help [at] perl.org
http://learn.perl.org/
Re: date handle
pyh [at] mail.nsbeta.info wrote:
> $ perl -MTime::Local -le 'print timelocal(0,0,0,1,1,1900)'
> Cannot handle date (0, 0, 0, 1, 1, 1900) at -e line 1
>
> why Time::Local can't handle the date of 1900?
Unix time starts at 1 Jan. 1970 so a time in 1900 is invalid.
John
--
Any intelligent fool can make things bigger and
more complex... It takes a touch of genius -
and a lot of courage to move in the opposite
direction. -- Albert Einstein
--
To unsubscribe, e-mail: beginners-unsubscribe [at] perl.org
For additional commands, e-mail: beginners-help [at] perl.org
http://learn.perl.org/
Re: date handle
At 22:17 -0800 30/01/2011, John W. Krahn wrote:
>pyh [at] mail.nsbeta.info wrote:
>>$ perl -MTime::Local -le 'print timelocal(0,0,0,1,1,1900)'
>>Cannot handle date (0, 0, 0, 1, 1, 1900) at -e line 1
>>
>>why Time::Local can't handle the date of 1900?
>
>Unix time starts at 1 Jan. 1970 so a time in 1900 is invalid.
Time for someone to RTFM I think!
<http://perldoc.perl.org/Time/Local.html>
#!/usr/local/bin/perl
use Time::Local 'timelocal_nocheck';
print scalar localtime timelocal_nocheck 0,0,0,1,1,1900;
JD
--
To unsubscribe, e-mail: beginners-unsubscribe [at] perl.org
For additional commands, e-mail: beginners-help [at] perl.org
http://learn.perl.org/