See Date::Manip and its DateCalc() method.
In reply to Re: More Date Arithmetic/Manipulation: Question by marto in thread More Date Arithmetic/Manipulation: Question by newbie01.perl