LupoX has asked for the wisdom of the Perl Monks concerning the following question:
Please help me to add knowledge to my brain.
Given following snippet:
use Time::Local; $from_year = $from_year - 1900; $from_month = $from_month - 1; $from = timelocal(0,0,0,$from_day,$from_month,$from_year); $to_year = $to_year - 1900; $to_month = $to_month - 1; $to = timelocal(0,0,0,$to_day,$to_month,$to_year); $days_between = ( ($to - $from) / (60 * 60 * 24) );
Now I use this values for input....
$from_day = 2; $from_month = 2; $from_year = 2002; $to_day = 5; $to_month = 2; $to_year = 2002;
.....and get the right result: $days_between = 3
But now to my confusion: I use this values......
$from_day = 2; $from_month = 2; $from_year = 2002; $to_day = 2; $to_month = 5; $to_year = 2002;
....the result ist not even: $days_between = 88.95...
Who can enlighten me?
Thanks for your experience-sharing!
Georg
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Time::Local -> timelocal()
by fglock (Vicar) on Sep 25, 2002 at 17:20 UTC | |
|
Re: Time::Local -> timelocal()
by lestrrat (Deacon) on Sep 25, 2002 at 19:19 UTC | |
|
Re: Time::Local -> timelocal()
by MZSanford (Curate) on Sep 26, 2002 at 13:43 UTC |