use Time::Local; my $date_epoc = timelocal(0,0,12,23,11,2007); my $end_date = timelocal(0,0,12,12,4,2008); my @date_array; push @date_array, '2008-11-23'; while ( $date_epoc < $end_date ) { # Might want <= instead: I'd have to check. $date_epoc = $date_epoc + 86400; my (undef, undef, undef, $day, $mon, $year) = localtime($date_epoc); push @date_array, "$year-$mon-$day"; $date_epoc = timelocal(0,0,12,$day,$mon,$year); }