# Epoch (computing)

In computing, an epoch is a fixed date and time used as a reference from which a computer measures system time. Most computer systems determine time as a number representing the seconds removed from a particular arbitrary date and time. For instance, Unix and POSIX measure time as the number of seconds that have passed since Thursday 1 January 1970 00:00:00 UT, a point in time known as the Unix epoch. The C# programming language and Windows NT systems up to and including Windows 11 and Windows Server 2022 measure time as the number of 100-nanosecond intervals that have passed since 00:00:00 UTC on 1 January in the years AD 1 and AD 1601, respectively, making those points in time the epochs for those systems. Computing epochs are almost always specified as midnight Universal Time on some particular date.

## Resolution and representation

Software timekeeping systems vary widely in the resolution of time measurement; some systems may use time units as large as a day, while others may use nanoseconds. For example, for an epoch date of midnight UTC (00:00) on 1 January 1900, and a time unit of a second, the time of the midnight (24:00) between 1 January 1900 and 2 January 1900 is represented by the number 86400, the number of seconds in one day. When times prior to the epoch need to be represented, it is common to use the same system, but with negative numbers.
Such representation of time is mainly for internal use. On systems where date and time are important in the human sense, software will almost always convert this internal number into a date and time representing a human calendar.

## Problems

Computers do not generally store arbitrarily large numbers. Instead, each number stored by a computer is allotted a fixed amount of space. Therefore, when the number of time units that have elapsed since a system's epoch exceeds the largest number that can fit in the space allotted to the time representation, the time representation overflows, and problems can occur. While a system's behavior after overflow occurs is not necessarily predictable, in most systems the number representing the time will reset to zero, and the computer system will think that the current time is the epoch time again.
Most famously, older systems that counted time as the number of years elapsed since the epoch of 1 January 1900 and which only allotted enough space to store the numbers 0 through 99, experienced the Year 2000 problem. These systems (if not corrected beforehand) would interpret the date 1 January 2000 as 1 January 1900, leading to unpredictable errors at the beginning of the year 2000.
Even systems that allocate more storage to the time representation are not immune from this kind of error. Many Unix-like operating systems which keep time as seconds elapsed from the epoch date of 1 January 1970, and allot timekeeping enough storage to store numbers as large as 2 147 483 647 will experience an overflow problem on 19 January 2038. This is known as the Year 2038 problem.
Other more subtle timekeeping problems exist in computing, such as accounting for leap seconds, which are not observed with any predictability or regularity. Additionally, applications that need to represent historical dates and times (for example, representing a date prior to the switch from the Julian calendar to the Gregorian calendar) must use specialized timekeeping libraries.
Finally, some software must maintain compatibility with older software that does not keep time in strict accordance with traditional timekeeping systems. For example, Microsoft Excel observes the fictional date of 29 February 1900 in order to maintain bug compatibility with older versions of Lotus 1-2-3. Lotus 1-2-3 observed the date due to an error; by the time the error was discovered, it was too late to fix it—"a change now would disrupt formulas which were written to accommodate this anomaly".

## In satellite-based time systems

There are at least six satellite navigation systems, all of which function by transmitting time signals. Of the only two satellite systems with global coverage, GPS calculates its time signal from an epoch, whereas GLONASS calculates time as an offset from UTC, with the UTC input adjusted for leap seconds. Of the only two other systems aiming for global coverage, Galileo calculates from an epoch and BeiDou calculates from UTC without adjustment for leap seconds. GPS also transmits the offset between UTC time and GPS time and must update this offset every time there is a leap second, requiring GPS-receiving devices to handle the update correctly. In contrast, leap seconds are transparent to GLONASS users. The complexities of calculating UTC from an epoch are explained by the European Space Agency in Galileo documentation under "Equations to correct system timescale to reference timescale".

## Notable epoch dates in computing

The following table lists epoch dates used by popular software and other computer-related systems. The time in these systems is stored as the quantity of a particular time unit (days, seconds, nanoseconds, etc.) that has elapsed since a stated time (usually midnight UTC at the beginning of the given date).
| Epoch date | Notable uses | Rationale for selection |
| 0 January 1 BC | MATLAB | "Year 0" in ISO 8601 |
| 1 January AD 1 | .NET, Go, REXX, Rata Die | Common Era, ISO 2014, RFC 3339 |
| 14 October 1582 | SPSS, IBM z/OS Language Environment, IBM AIX COBOL | Same as below, but with one-based indexing |
| 15 October 1582 | UUID version 1 | The date of the Gregorian reform to the Christian calendar. |
| 1 January 1601 | NTFS, COBOL, Win32/Win64 (NT time epoch) | 1601 was the first year of the 400-year Gregorian calendar cycle at the time Windows NT was made. |
| 31 December 1840 | MUMPS programming language | 1841 was a non-leap year several years before the birth year of the oldest living US citizen when the language was designed. |
| 17 November 1858 | VMS, United States Naval Observatory, DVB SI 16-bit day stamps, other astronomy-related computations | 17 November 1858, 00:00:00 UT is the zero of the Modified Julian Day (MJD) equivalent to Julian day 2400000.5 |
| 10 May 1869 | PHAMIS date, used in Lastword/Carecast/Centricity Enterprise EHR running on Tandem/NonStop servers | The date of the transcontinental railroad Golden Spike, when the Central Pacific and Union Pacific railroads finally met at Promontory Summit, UT in May 1869. |
| 30 December 1899 | Microsoft COM DATE, Object Pascal, LibreOffice Calc, Google Sheets | Technical internal value used by Microsoft Excel; for compatibility with Lotus 1-2-3. |
| 31 December 1899 | Dyalog APL, Microsoft C/C++ 7.0 | Chosen so that (date mod 7) would produce 0=Sunday, 1=Monday, 2=Tuesday, 3=Wednesday, 4=Thursday, 5=Friday, and 6=Saturday. Microsoft’s last version of non-Visual C/C++ used this, but was subsequently reverted. |
| 0 January 1900 | Microsoft Excel, Lotus 1-2-3 | While logically 0 January 1900 is equivalent to 31 December 1899, these systems do not allow users to specify the latter date. Since 1900 is incorrectly treated as a leap year in these systems, 0 January 1900 actually corresponds to the historical date of 30 December 1899. |
| 1 January 1900 | Network Time Protocol, Time Protocol, IBM CICS, Mathematica, RISC OS, VME, Common Lisp, Michigan Terminal System | |
| 1 January 1901 | Ada | In the first version of the language, dates were limited to the range 1901 to 2099 to avoid years affected by the 400 year leap year rule. When the upper bound was expanded in later versions, the lower bound was left the same to maintain backward compatibility with systems that used it as a datum. |
| 1 January 1904 | LabVIEW, Apple Inc.'s classic Mac OS, JMP Scripting Language, Palm OS, MP4, Microsoft Excel (optionally), IGOR Pro | 1904 is the first leap year of the 20th century. |
| 1 January 1960 | SAS System | |
| 31 December 1967 | Pick OS and variants (jBASE, Universe, Unidata, Revelation, Reality) | Chosen so that (date mod 7) would produce 0=Sunday, 1=Monday, 2=Tuesday, 3=Wednesday, 4=Thursday, 5=Friday, and 6=Saturday. |
| 1 January 1970 | Unix Epoch used in POSIX time, used by Unix and Unix-like systems (Linux, macOS, Android), and programming languages: most C/C++ implementations, Java, JavaScript, Perl, PHP, Python, Ruby, Tcl, ActionScript. Also used by Precision Time Protocol. | |
| 1 January 1978 | AmigaOS. The Commodore Amiga hardware systems were introduced between 1985 and 1994. Latest OS version 4.1 (December 2016). AROS, MorphOS. | |
| 1 January 1980 | IBM BIOS INT 1Ah, DOS, OS/2, FAT12, FAT16, FAT32, exFAT filesystems, ZIP format and derivatives | The IBM PC with its BIOS as well as 86-DOS, MS-DOS and PC DOS with their FAT12 file system were developed and introduced between 1980 and 1981. |
| 6 January 1980 | Qualcomm BREW, GPS, ATSC 32-bit time stamps | GPS counts weeks (a week is defined to start on Sunday) and 6 January is the first Sunday of 1980. Weeks are stored in a 10-bit integer, and the first GPS week number rollover occurred in August 1999. |
| 31 December 1989 | Garmin FIT Epoch. Standard originated by Garmin as part of their FIT Protocol, which has been adopted by many as a de facto standard in the fitness devices industry. | |
| 1 January 2000 | AppleSingle, AppleDouble, PostgreSQL, Zigbee UTCTime, Ingenuity helicopter | This Y2K epoch is used sometimes to push the 2038 problem to the year 2068, if the processor does not support 64-bit. |
| 1 January 2001 | NSDate in Apple's Cocoa framework, NeXTSTEP | First day of the third millennium A.D. |