in reply to Time::Local -> timelocal()

Try it again with  timegm() - you might be getting a daylight savings transition.

From the Time::Local docs:

We just assume that we're translating a GMT time, and then fudge it when we're done for the timezone and daylight savings arguments. Note that the timezone is evaluated for each date because countries occasionally change their official timezones. Assuming that localtime() corrects for these changes, this routine will also be correct. The daylight savings offset is currently assumed to be one hour.