in reply to Comparing two dates and getting back difference in days

Date_Cmp just returns if $date1 is smaller than, equal to, or greater than $date2, like the Perl cmp operator.

What you want to do can be done with the DateCalc function. See the documentation of Date::Manip for details.

The Date::Calc module is implemented mostly in C and should be a lot faster.

Arjen

Replies are listed 'Best First'.
Re: Re: Comparing two dates and getting back difference in days
by TASdvlper (Monk) on Jan 21, 2004 at 17:20 UTC
    Ok, I'm looking at DateCalc but I can't seem to figure out how to get the output in just days. I'm getting output that looks like this:
    2004-01-14 2004-01-21 +0:0:1:0:0:0:0
    Do I have to do my own conversion to just days ? Also, I could seem to figure out what the $err was supposed to be.