sub date_to_seconds{ my ($date, $time) = split(/\s/,shift(@_)); my ($year, $month, $day) = split(/-/, $date); my ($h, $m, $s) = split(/:/, $time); $month--; return timelocal($s, $m, $h, $day, $month, $year); }