my ($second, $minute, $hour, $dayOfMonth, $month, $yearOffset, $dayOfWeek, $dayOfYear, $isDST) = localtime(); $year += 1900; # get absolute year $month++; # you'd expect the January to be the first # month, not the 0th ;-)