bangor has asked for the wisdom of the Perl Monks concerning the following question:
This works, but i have to do this a lot of times and wonder if there is a faster way, like a single calculation rather than my three here. Thanks for any help.sub parse_duration { my $seconds = shift; my $hours = int( $seconds / (60*60) ); my $mins = ( $seconds / 60 ) % 60; my $secs = $seconds % 60; return sprintf("%02d:%02d:%02d", $hours,$mins,$secs); }
|
|---|