>From Date::Calc :
o $Dd = Delta_Days($year1,$month1,$day1,
$year2,$month2,$day2);
This function returns the difference in days between the
two given dates.
The result is positive if the two dates are in
chronological order, i.e., if date #1 comes
chronologically BEFORE date #2, and negative if the
order of the two dates is reversed.
The result is zero if the two dates are identical.
Hope this helps,
- nick
~~~~~~~~~~~~~~~~~~~~
Nick Tonkin {|8^)>
On Thu, 9 Jan 2003, Darren Young wrote:
> I'm trying to find a way to take 2 dates, such as 2003-01-08 &
> 2003-01-10 and see how many days there are between them. I started with
> the Date::Range module and that works ok. The thing is some of the dates
> that could be supplied might be in the past. If I feed Date::Range 2
> dates, one now and one in the past it returns the number of days between
> the 2 which I imagine is what it's supposed to do. I gues I expected it
> to return a negative number or something.
>
> Is there some method, perhaps an existing module, that can tell me if a
> date is in the past or the future? If that tells me it's in the future I
> can then run it through Date::Range.
>
> Thanks,
>
> Darren
>
>