Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
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 about the Monastery: (4)
As of 2024-04-24 13:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found