The localtime function converts a time value into an array of nine elements.
You can extract each of the elements with code like the following:
($sec, $min, $hour, $dom, $mon, $year, $wday, $yday, $isdst) = localtime($time);
Array Values Returned by localtime Functions
$sec Seconds after the minute, from 0 to 59.
$min Minutes after the hour, from 0 to 59.
$hour Hour of day, from 0 to 23.
$dom Day of month, from 1 to 31.
$mon Month of year, from 0 to 11.
$year Years since 1900.
$wday Days since Sunday, from 0 to 6.
$yday Days since January 1, from 0 to 365.
$isdst Daylight-savings time; > 0 if in effect, 0 if not, < 0 if Perl can't tell.