in reply to time difference calculation

You've got a simple typo (which use strict; use warnings; would have pointed out to you...)
#$end=timegm(gmtime()); #should be $end_secs=timegm(gmtime());

Mike

Replies are listed 'Best First'.
Re^2: time difference calculation
by Anonymous Monk on Oct 28, 2013 at 12:43 UTC
    D'oh! Thanks.

    That still doesn't seem correct, as I'm getting a difference of around 750 hours.

      You have a difference of 750 hours. Have you looked at the expected time difference?

      Maybe you want to study again the exact ranges of allowed input parameters for Time::Local. Especially re-read the second paragraph of the description, where the documentation draws particular attention to the allowed values for the month.

      Maybe you want to try the following dates and study the error message you get

      2013-02-31 2013-01-28 2013-01-29 2013-01-30 2013-01-31