develooper Front page | perl.datetime | Postings from January 2003

Date Comparison

Thread Next
From:
Darren Young
Date:
January 9, 2003 11:54
Subject:
Date Comparison
Message ID:
003b01c2b818$ef8c4b30$67fea8c0@lakeforest.thefreightdepot.com
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


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About