in reply to Elapsed date and time
You could so the same with end time and subtract them..use Time::Local; # Second - Min - Hour - Day - Month - Year my $starttime = timelocal($seconds, $mins, $hours, $day, $month, $year +);
Something like ...
Any more expreienced monks to fix the above code would be appreciated.Regards$starttime = 1031079733; $endtime = 1013104442; $diff = $starttime - $endtime; print "there is $diff secconds between the 2\n"; $sec = $diff % 60; $diff = ($diff - $sec) / 60; $min = $diff % 60; $diff = ($diff - $min) / 60; $hrs = $diff % 24; $diff = ($diff - $hrs) / 24; $day = $diff % 7; $diff = ($diff - $day) / 7; $week = $diff % 4; $diff = ($diff - $week) / 4; $mnt = $diff % 12; $diff = ($diff - $mnt); $year = $diff; print "\n\nDifferencre is $year Years $mnt Months $week Weeks $day Day +s, $hrs Hours, $min Minutes and $sec Seconds\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Elapsed date and time
by parv (Parson) on Mar 04, 2003 at 21:48 UTC |