Thread Zeitangaben addieren: h:min + h:min = ? (8 answers)
Opened by MartinR at 2006-11-17 15:06

bloonix
 2006-11-23 18:33
#71836 #71836
User since
2005-12-17
1615 Artikel
HausmeisterIn
[Homepage]
user image
[quote=docsnyder,23.11.2006, 13:31]
Code: (dl )
1
2
3
4
5
sub addTimes {
 return(sprintf("%d %d:%d:%d", $d=int(($ts=((@ta=split(':', $_[0]))[0]*3600+$ta[1]*60+$ta[2]+(@tb=split(':', $_[1]))[0]*3600+$tb[1]*60+$tb[2]))/86400), $h=int(($ts=$ts-($d*86400))/3600), $m=int(($ts=$ts-($h*3600))/60),$s=int(($ts=$ts-($m*60))/60)));
}

print addTimes('13:45:23', '14:12:43') . "\n";
[/quote]
Aber nicht ...

Code: (dl )
print addTimes('13:45:23', '14:12:43', '15:21:23') . "\n";


:p
What is a good module? That's hard to say.
What is good code? That's also hard to say.
One man's Thing of Beauty is another's man's Evil Hack.

View full thread Zeitangaben addieren: h:min + h:min = ?