Announcement

Collapse
No announcement yet.

How to do this?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How to do this?

    OK, so I noticed something at the bottom of badcaps.net that intrigued me:
    "Server has been up for 11 Days, 8 Hours, and 4 Minutes."

    How do I add that to my server's website?
    Thanks!

    #2
    Re: How to do this?

    on Linux you have the "uptime" command...dump contents in a file then parse the time info...
    http://www.ruchirablog.com/simple-ph...uptime-script/

    on Windows, you have systeminfo which dumps a ton of crap but also tells the date/time system was booted so you can grab that.
    There's also Windows API that can tell you ...GetTickCount tells number of ms since windows booted (but it's 32bit value so 2 billion ms and then resets) and there's other ways to determine (wmi instrumentation, shell scripting, other api funcitons etc)

    http://en.wikipedia.org/wiki/Uptime
    Last edited by mariushm; 01-22-2012, 01:16 PM.

    Comment


      #3
      Re: How to do this?

      Thank you very much, I will try those

      Comment

      Working...
      X