Alternatively, I have manipulated dates via the 'time' and 'localtime' functions. Since the 'time' function deals in seconds since 1.1.1970, you can do all you manipulations in seconds ( not really that big-a-deal) and use 'localtime' to convert it for output. This is very straightforward and flexible.
I've also used Date::Manip in the past - very nice package that does almost any date math you can think of, but even the documentation says that it is NOT fast. If you are batch processing many many records, and you need to do date math on each one, and time is critical, then Date::Manip is probably not what you want to use. If all you need to do is add or subtract days to/from a given date, then you might be better off writing your own(assuming you can get both dates in the form "seconds since the Epoch" as "goBoating" suggested), or another CPAN alternative is Date::Calc, but I have no experience with that one.
Hardy Merrill
Mission Critical Linux, Inc.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.