sub sec_to_ddmmss { my $t = shift; return int($t / 86400), (gmtime($t))[2, 1, 0]; }
This is clever, but I'd like to see it commented because at first glance, it might appear erroneous. It should be better named too. I'd probably call it seconds_to_dhms(). Yours is broken in two respects: 1) you missed 'hh' for hours and 2) the doubled letters imply that your return values are formatted to two digits.
-sauoq "My two cents aren't worth a dime.";
In reply to Re^2: Converting seconds to DD:HH:MM:SS
by sauoq
in thread Converting seconds to DD:HH:MM:SS
by McDarren
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |