in reply to Re: Find minutes difference between two dates
in thread Find minutes difference between two dates

any suggestions for correction ?

Oh. I forgot that timelocal expects the month parameter to be in the range of 0..11, 0 being January and 11 being december.

my $start_time = timelocal($start_time[5], $start_time[4], $start_time +[3], $start_time[2], $start_time[1]-1, $start_time[0]); my $end_time = timelocal($end_time[5], $end_time[4], $end_time[3], $ +end_time[2], $end_time[1]-1, $end_time[0]);
Note the -1's.

Ikegami's solution is much better when it comes to readability and maintainability, but mine is probably cheaper.