Depending on your situation it might be a good idea to rethink your data. Personally, I'm a big fan of doing date/time calculations using # of seconds since the epoch (that is, on Unix, time and date are described as the number of seconds since January 1, 1970.) Number of seconds is a very handy format: it's easy to sort, easy to manipulate (need to add or subtract a minute/hour/day/month? Piece of cake!) and easily transferable back and forth into something legible using localtime() and Time::Local.
Of course, you might not have that option... but IMHO dealing in epoch-time is a good habit to get into.