Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

RE: Re: Converting Seconds to Nice Format

by blogan (Monk)
on Nov 12, 2000 at 07:23 UTC ( [id://41150]=note: print w/replies, xml ) Need Help??


in reply to Re: Converting Seconds to Nice Format
in thread Converting Seconds to Nice Format

Your code looks file, but I would suggest that you may want to reorder the lines so it looks a little better.
$up = `cat /proc/uptime`; $up =~ m/[^ .]*/; $upseconds = $&; $seconds = (int($upseconds)) % 60; $minutes = (int($upseconds / (60))) % 60; $hours = (int($upseconds / (60*60))) % 24; $days = (int($upseconds / (60*60*24))) % 7; $weeks = (int($upseconds / (60*60*24*7))) % 52; $years = (int($upseconds / (60*60*24*365))) % 10; $decades = (int($upseconds / (60*60*24*365*10)));

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2024-11-11 21:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    chatterbot is...






    Results (39 votes). Check out past polls.