Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

RE: Convert seconds into a formatted ddd:hh:mm:ss string

by BlaisePascal (Monk)
on Aug 31, 2000 at 01:35 UTC ( [id://30415]=note: print w/replies, xml ) Need Help??


in reply to Convert seconds into a formatted ddd:hh:mm:ss string

my entry..
sub sec2string { my $sec = shift; my @str; for $d (60, 60, 24) { my $m = $sec % $d; $sec /= $d; $m = $m < 10 ? '0'.$m; unshift @str,$m; } return "$sec:" . join ":",@str; }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://30415]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2024-04-19 14:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found