In comp.lang.perl.misc on 27 Aug 2004 16:35:04 -0700
Marcus <> wrote:
> Can someone pls show the most solid way in perl to retrieve the number
> of days ago a specific date string was?
>
> Input: 2003-07-20
> Output: 395
>
Date::Manip is one way.
4. The amount of time between two dates.
$date1=&ParseDate($string1);
$date2=&ParseDate($string2);
$delta=&DateCalc($date1,$date2,\$err);
=> 0:0:WK

D:HH:MM:SS the weeks, days, hours, minutes,
and seconds between the two
$delta=&DateCalc($date1,$date2,\$err,1);
=> YY:MM:WK

D:HH:MM:SS the years, months, etc. between
the two
There are other Date modules, that's just the one I've been using
because I handle dates in all sorts of weird formats and do all sorts of
weird thigns with them, it handles everything so far.
Zebee