|
|
| No such thing as a small change | |
| PerlMonks |
Why does localtime() return $YEAR-1900?by szabgab (Priest) |
| on Jan 31, 2011 at 11:40 UTC ( #885251=perlquestion: print w/ replies, xml ) | Need Help?? |
|
szabgab has asked for the
wisdom of the Perl Monks concerning the following question:
field 5 returned by localtime() in list context is the year.
In order to get back the date one needs to write $year + 1900.
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); Does anyone know why did Larry make it that way? UpdateTitle corrected thanks to Re: Why does localtime() return 1900-$YEAR?
Back to
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||||||||