I don't think anybody has mentioned this, but have you thought
about using Time::Local? It is a core module ( bonus for
portability ) and, to quote the manpage:
These routines are the inverse of built-in perl fuctions
localtime() and gmtime(). They accept a date as a six-
element array, and return the corresponding time(2) value
in seconds since the Epoch (Midnight, January 1, 1970).
This value can be positive or negative.
I haven't done any bench marking, but I use these frequently
to translate a human readable date ( like those found in
syslogs and the like ) into seconds since the
epoch. That makes it very easy to compare two dates, to
calculate the delta between two dates, etc., without having
to worry about month boundaries, leap years and other items
that I almost always get wrong anyway.
If I have read what you are trying to do correctly, I think
this module will do what you want.
mikfire