in reply to Converting Seconds to Nice Format
Or to to it without using external modules, you could do something like this:
--use strict; my $secs = 1_000_000; my $days = int($secs / 86_400); $secs -= ($days * 86_400); my $hours = int($secs / 3600); $secs -= ($hours * 3600); my $mins = int($secs / 60); $secs -= ($mins * 60); print "1,000,000 seconds is $days days, $hours hours, $mins mins and $ +secs seconds\n"
"Perl makes the fun jobs fun
and the boring jobs bearable" - me
|
|---|