The moose likes Beginning Java and the fly likes System Up Time Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "System Up Time" Watch "System Up Time" New topic

System Up Time

Bill Norton

Joined: Mar 29, 2001
Posts: 27
Let me be more more specific.
In rfc1514 a variable is described as
systemUpTime which is how long it has been since the system was initialized.
I believe almost any system(Linux, Solaris, NT, HPUX, etc) keeps this information somehow. I was hoping that there was a Java method which would return this value.
Thank you,

[This message has been edited by Bill Norton (edited April 10, 2001).]
Cindy Glass
"The Hood"

Joined: Sep 29, 2000
Posts: 8521
Up time?? Time it was turned on? Time it has been running since turned on?? Either way I don't think that windows (at any rate) tracks either of those.

"JavaRanch, where the deer and the Certified play" - David O'Meara
Randall Twede
Ranch Hand

Joined: Oct 21, 2000
Posts: 4351

Im not sure what you mean by current system's up time.
But if this helps any, If you are using servlets, you can find out how long since the server was booted by recording when init() was called with this code in the init() method:
String dateTime = DateFormat.getDateTimeInstance().format(date);
then to find elapsed time you would have to use the same line(with different variable name) and do some math.
not sure if that helps any.
Dont blindly believe everything I say.

Visit my download page
I agree. Here's the link:
subject: System Up Time
It's not a secret anymore!