Uptime

Uptime is a measure of system reliability, expressed as the percentage of time a machine, typically a computer, has been working and available. Uptime is the opposite of downtime.
It is often used as a measure of computer operating system reliability or stability, in that this time represents the time a computer can be left unattended without crashing, or needing to be rebooted for administrative or maintenance purposes.
Conversely, long uptime may indicate negligence, because some critical updates can require reboots on some platforms.
Records.
In 2005, Novell reported a server with a 6-year uptime. Although that might sound unusual, that is actually common when servers are maintained under an industrial context and host critical applications such as banking systems.
Netcraft maintains the uptime records for many thousands of web hosting computers.
A server running Novell NetWare has been reported to have been shut down after 16 years of uptime due to a failing hard disk.
Determining system uptime.
Microsoft Windows.
Windows Task Manager.
Some versions of Microsoft Windows include an uptime field in Windows Task Manager, under the "Performance" tab. The format is D:HH:MM:SS (days, hours, minutes, seconds).
systeminfo.
The output of the codice_1 command includes a "System Up Time" or "System Boot Time" field.
C:\>systeminfo | findstr "Time:"
System Up Time: 0 Days, 8 Hours, 7 Minutes, 19 Seconds
The exact text and format is dependent on the language and locale. The time given by codice_1 is not reliable. It does not take into account time spent in sleep or hibernation. Thus, the boot time will drift forward every time the computer sleeps or hibernates.
NET command.
The codice_3 command with its codice_4 sub-command provides the date and time the computer started, for both the codice_5 and codice_6 variants. The command codice_7 is shorthand for codice_6. The exact text and date format is dependent on the configured language and locale.
C:\>NET STATISTICS WORKSTATION | findstr "since"
Statistics since 8/31/2009 8:52:29 PM
Windows Management Instrumentation (WMI).
Uptime can be determined via Windows Management Instrumentation (WMI), by querying the codice_9 property of the codice_10 class. At the command prompt, this can be done using the codice_11 command:
C:\>wmic os get lastbootuptime
LastBootUpTime
20110508161751.822066+060
The timestamp uses the format codice_12, so in the above example, the computer last booted up on 8 May 2011 at 16:17:51.822. The text "LastBootUpTime" and the timestamp format do not vary with language or locale. WMI can also be queried using a variety of application programming interfaces, including VBScript or PowerShell.
Uptime.exe.
Microsoft formerly provided a downloadable utility called codice_13, which reports elapsed time in days, hours, minutes, and seconds.
C:\>Uptime
SYSTEMNAME has been up for: 2 day(s), 4 hour(s), 24 minute(s), 47 second(s)
The time given by codice_13 is not reliable. It does not take into account time spent in sleep or hibernation. Thus, the boot time will drifts forward every time the computer sleeps or hibernates.
FreeDOS.
The codice_15 command is also available for FreeDOS. The version was developed by M. Aitchison.
Linux.
Using uptime.
Users of Linux systems can use the BSD uptime utility, which also displays the system load averages for the past 1, 5 and 15 minute intervals:
$ uptime
 18:17:07 up 68 days, 3:57, 6 users, load average: 0.16, 0.07, 0.06
Using /proc/uptime.
Shows how long the system has been on since it was last restarted:
$ cat /proc/uptime
 350735.47 234388.90
The first number is the total number of seconds the system has been up. The second number is how much of that time the machine has spent idle, in seconds. On multi core systems (and some Linux versions) the second number is the sum of the idle time accumulated by each CPU.
BSD.
Using uptime.
BSD-based operating systems such as FreeBSD, Mac OS X and SySVr4 have the "uptime" command (See ).
$ uptime
3:01AM up 69 days, 7:53, 0 users, load averages: 0.08, 0.07, 0.05
Using sysctl.
There is also a method of using "sysctl" to call the system's last boot time:
$ sysctl kern.boottime
kern.boottime: { sec = 1271934886, usec = 667779 } Thu Apr 22 12:14:46 2010
OpenVMS.
On OpenVMS systems, the codice_16 command can be used at the DCL command prompt to obtain the system uptime. The first line of the resulting display includes the system's uptime, displayed as days followed by hours:minutes:seconds. In the following example, the command qualifier codice_17 suppresses the display of per-process detail lines of information.
$ show system/noprocess
OpenVMS V7.3-2 on node JACK 29-JAN-2008 16:32:04.67 Uptime 894 22:28:52
The command output above shows that node JACK on 29 January 2008 at 16:32:04.67 has uptime: 894 days 22 hours 28 minutes and 52 seconds.