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?
Update
Title corrected thanks to Re: Why does localtime() return 1900-$YEAR?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Why does localtime() return 1900-$YEAR?
by bart (Canon) on Jan 31, 2011 at 12:00 UTC | |
by apl (Monsignor) on Jan 31, 2011 at 12:44 UTC | |
by szabgab (Priest) on Jan 31, 2011 at 13:51 UTC | |
by ikegami (Patriarch) on Jan 31, 2011 at 16:15 UTC | |
by Utilitarian (Vicar) on Feb 01, 2011 at 09:28 UTC | |
by apl (Monsignor) on Feb 01, 2011 at 11:11 UTC | |
Re: Why does localtime() return $YEAR-1900?
by cdarke (Prior) on Jan 31, 2011 at 13:29 UTC | |
Re: Why does localtime() return 1900-$YEAR?
by marto (Cardinal) on Jan 31, 2011 at 11:59 UTC |
Back to
Seekers of Perl Wisdom