System time is measured by a system clock, which is typically implemented as a simple count of the number of ticks that have transpired since some arbitrary starting date, called the epoch. For example, Unix and POSIX-compliant systems encode system time as the number of seconds elapsed since the start of the epoch at 1970-01-01 00:00:00 Z. Microsoft Windows counts the number of 100-nanosecond ticks since 1601-01-01 00:00:00 Z as reckoned in the proleptic Gregorian calendar, but returns the current time to the nearest millisecond.
System time can be converted into calendar time, which is a form more suitable for human comprehension. For example, the Unix system time that is 1,000,000,000 seconds since the beginning of the epoch translates into the calendar time 2001-09-09 01:46:40 UTC (sans leap seconds). Library subroutines that handle such conversions may also deal with adjustments for timezones, Daylight Saving Time (DST), leap seconds, and the user's locale settings. Library routines are also generally provided that convert calendar times into system times.
Closely related to system time is process time, which is a count of the total CPU time consumed by an executing process. It may be split into user and system CPU time, representing the time spent executing user code and system kernel code, respectively. Process times are a tally of CPU instructions or clock cycles and generally have no direct correlation to wall time.
It should be noted that most first-generation PCs did not keep track of dates and times. These included systems that ran the CP/M operating system, the Apple II, and the Commodore PET, among others. The IBM PC was the first widely available personal computer that came equipped with date/time hardware built into the motherboard, and subsequent add-on peripheral boards included real-time clock chips with on-board battery back-up. Prior to the widespread availability of computer networks, most personal computer systems that did track system time did so only with respect to local time and did not make allowances for other time zones.
With current technology, all modern computers keep track of wall time, as do many other household and personal devices such as VCRs, DVRs, cable TV receivers, PDAs, pagers, cell phones, fax machines, telephone answering machines, cameras, camcorders, central air conditioners, and microwave ovens.
The following tables illustrate methods for retrieving the system time in various operating systems and programming languages. Note: values marked by (*) are system-dependent and may differ across implementations.
|Operating System||Command or Function||Resolution||Epoch|
|BIOS (IBM PC)||INT 1Ah,AH=00h|| 54.931 msec|
|Midnight of the current day|
|INT 1Ah,AH=02h||1 sec||January 1, 1980|
|DOS (Microsoft)|| TIME|
|10 msec||January 1, 1980 to December 31, 2099|
|Mac OS (Apple)||GetDateTime()||1 sec||January 1, 1904 to February 6, 2040|
|OpenVMS (HP)||SYS$GETTIM()||100 nsec||November 17, 1858 to AD 31086|
|z/OS (IBM)||STCK|| 2−12 μsec|
|January 1, 1900 to September 17, 2042|
|Unix, POSIX|| |
January 1, 1970 to January 19, 2038
January 1, 1970 to AD 292277026596
|Windows (Microsoft)||GetSystemTime()||1 msec||January 1, 1601 to AD 30828|
|Programming Language||Function or Variable||Resolution||Epoch|
|Ada||Ada.Calendar.Clock|| 100 μsec to|
20 msec (*)
|January 1, 1901 to December 31, 2099 (*)|
|BASIC, True BASIC|| DATE, DATE$|
|C||time()||1 sec (*)||(*)|
|C++||std::time()||1 sec (*)||(*)|
|C#||System.DateTime.Now||100 nsec||January 1, 0001 to December 31, 9999|
|CICS (IBM)||ASKTIME||1 msec||January 1, 1900|
|COBOL||FUNCTION CURRENT-DATE||1 sec||January 1, 1601|
|Delphi (Borland)|| date|
| 1 msec|
|January 1, 1900|
|Java||java.util.Date()||1 msec||January 1, 1970|
|MUMPS||$H (short for $HOROLOG)||1 sec||December 31, 1840|
|Extended Pascal||GetTimeStamp()||1 sec||(*)|
|Turbo Pascal|| GetTime()|
|Perl||time()||1 sec||January 1, 1970|
|1 sec||January 1, 1970|
|Python||time.time()||1 μsec (*)||January 1, 1970|
|Ruby||Time.now()||1 sec||January 1, 1970 to January 19, 2038|
|Smalltalk|| Time microsecondClock|
| 1 sec (ANSI)|
1 μsec (VisualWorks)
1 sec (Squeak)
|January 1, 1901 (*)|
| Time totalSeconds|
| SystemClock ticksNowSinceSystemClockEpoch|
|3 msec||January 1, 1753 to December 31, 9999 (*)|
|60 sec||January 1, 1900 to June 6, 2079|
|TCL||[clock seconds]||1 sec||January 1, 1970|
|[clock milliseconds]||1 msec|
|[clock microseconds]||1 μsec|
|[clock clicks]||1 μsec (*)||(*)|
|Windows PowerShell||Get-Date||100 nsec||January 1, 0001 to December 31, 9999|
|Visual Basic .NET||System.DateTime.Now|
US Patent Issued to The Boeing on March 20 for "Method and System for Establishing a System Time Within a Mobile Ad Hoc Network" (Kansas Inventors)
Mar 27, 2012; ALEXANDRIA, Va., March 27 -- United States Patent no. 8,139,558, issued on March 20, was assigned to The Boeing Co. (Chicago)....
US Patent Issued to Research in Motion on April 16 for "Method and System for Reduced System-Time Overhead Parameter Length Representation for Inter-Radio Access Technology Communication" (Canadian, American Inventors)
Apr 16, 2013; ALEXANDRIA, Va., April 16 -- United States Patent no. 8,422,616, issued on April 16, was assigned to Research In Motion Ltd....
US Patent Issued to QUALCOMM on June 25 for "Handling of Disrupted Synchronous Hybrid Automatic Repeat Request (HARQ) Cycle at System Time Rollover" (French, American Inventors)
Jun 25, 2013; ALEXANDRIA, Va., June 25 -- United States Patent no. 8,473,799, issued on June 25, was assigned to QUALCOMM Inc. (San...