rpike has asked for the wisdom of the Perl Monks concerning the following question:

Is there a way to use DateCalc from Date::Manip to subtract 2 dates? For example, 08-19-2009 subtract 03-25-2007. I need to determine the number of days, weeks, etc.., between the 2 dates.

Replies are listed 'Best First'.
Re: Date subtraction using DateCalc
by Your Mother (Archbishop) on Aug 19, 2009 at 15:34 UTC

    Yes. Search for "delta" in its thorough documentation: Date::Calc. Excepting the problem space, Date::Calc is completely unrelated to Date::Manip.

      There is a DateCalc function within Date::Manip. I found the problem, month and day were in the wrong positions (switched) and the difference was returning empty slots instead of numbers for year, month, week, etc..,. Thanks for the reply.

        Whoops. Sorry about that. Looking at the doc for the function, that's not much fun. :( If you have Date::Calc or can get it, I'd recommend it strongly over the Date::Manip stuff. DateTime is another excellent choice (slow but *many* features).