Use Date::Calc, it is very good at dealing with dates!
Read: http://www.perl.com/doc/manual/html/pod/perlfunc/localtime.html
Excerpt: All array elements are numeric, and come straight out of a struct tm. In particular this means that $mon has the range 0..11 and $wday has the range 0..6 with sunday as day 0. Also, $year is the number of years since 1900, that is, $year is 123 in year 2023, and not simply the last two digits of the year...
Danny M.
Not a Perl monk but definitely a Perl advocate!