in reply to Re: Time::Piece errors?
in thread Time::Piece errors?

This is a problem with daylight-saving. Time::Piece->strptime creates a GMT date, which you're then comparing to localtime()'s representation of time(), so it appears to be an hour out. You'll probably need to use the isdst() function to add ONE_HOUR if necessary. BTW, there's another slight cut'n'paste error - you need to subtract $days * ONE_DAY as well, and then swap the rest of your lines to the bottom of that block.

Hope this helps
Ben.