#split date into seperate vars my($day, $month, $mday, $time, $year) = split(" ", $datetime); my($timeh, $timem, $times) = split(':', $time); #this function calculates the number of seconds that have passed since + Midnight, January 1, 1970 my $time = timegm($times,$timem,$timeh,$mday,$month,$year);