http://www.perlmonks.org?node_id=627896


in reply to Strage result using localtime to convert epoch time

You're using Time::localtime, which replaces the build-in localtime() function with one that returns a Time::tm object.

To fix the issue, don't use Time::localtime.