in reply to adding time variables together
However, to add times with adjustments in hours, you can do the following:
sub addtime { my ( $time1, $time2 ) = @_; my $min1 = $time1 % 100; my $hour1 = $time1 - $min1; my $min2 = $time2 % 100; my $hour2 = $time2 - $min2; my $hour3 = $hour1+$hour2; my $min3 = $min1+$min2; if ( $min3 > 59 ) { $min3 -= 60; $hour3++; } return $hour3*100 + $min3; }
-----------------------------------------------------
Dr. Michael K. Neylon - mneylon-pm@masemware.com
||
"You've left the lens cap of your mind on again, Pinky" - The Brain
"I can see my house from here!"
It's not what you know, but knowing how to find it if you don't know that's important
|
|---|