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.
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.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".4
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.5[needs update?] 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".6
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).
"[MS-DTYP]: FILETIME". Microsoft Docs. 2020-03-30. https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-dtyp/2c57429b-fdd4-488f-b5fc-9e4cf020fcdf ↩
"GregorianCalendar Class". MSDN. Remarks. Retrieved 2015-04-26. https://msdn.microsoft.com/en-us/library/system.globalization.gregoriancalendar(v=vs.110).aspx ↩
Spolsky, Joel (2008-02-19). "Why are the Microsoft Office file formats so complicated? (And some workarounds)". Retrieved 2009-03-08. http://www.joelonsoftware.com/items/2008/02/19.html ↩
Dershowitz, Nachum; Reingold, Edward (2008). Calendrical Calculations (3 ed.). Cambridge University Press. pp. xxi, xxvi. ISBN 978-0-521-70238-6. 978-0-521-70238-6 ↩
Subirana, J. Sanz; Zornoza, J. M. Juan; Hernández-Pajares, M. (2011). "Time References in GNSS". gssc.esa.int/navipedia. European Space Agency. http://www.navipedia.net/index.php/Time_References_in_GNSS ↩
"GNSS Timescale Description Galileo" (PDF). United Nations Office for Outer Space Affairs. 2016. Section 5d. http://www.unoosa.org/pdf/icg/2016/gst2016.pdf ↩
Proleptic Gregorian calendar. /wiki/Proleptic_Gregorian_calendar ↩
"datenum", MathWorks, accessed 7 July 2015. http://www.mathworks.com/help/matlab/ref/datenum.html ↩
"DateTimeOffset Structure" (.NET Framework 4.5), MSDN, 2015. https://msdn.microsoft.com/en-us/library/system.datetimeoffset%28v=vs.110%29.aspx ↩
"Package time". golang.org. Retrieved 2015-04-26. https://golang.org/pkg/time/#Time ↩
"Date—z/OS TSO/E REXX Reference". IBM.com. IBM. 2014. SA32-0972-00. http://www-01.ibm.com/support/knowledgecenter/SSLTBW_2.1.0/com.ibm.zos.v2r1.ikja300/date.htm ↩
Dershowitz, Nachum; Reingold, Edward (2008). "The Gregorian calendar". Calendrical Calculations (3 ed.). Cambridge University Press. ISBN 978-0-521-70238-6. 978-0-521-70238-6 ↩
Cowlishaw, Mike Frederic (1990). The Rexx Language: A Practical Approach to Programming (2 ed.). Prentice Hall. pp. 93, 177. ISBN 0-13-780651-5. 0-13-780651-5 ↩
"Go 1 Release Notes—Major changes to the library—Time". golang.org. 2012-03-28. Retrieved 2015-04-26. https://golang.org/doc/go1#time ↩
"Date and Time Formats". IBM.com. IBM. Retrieved 2020-01-24. https://www.ibm.com/support/knowledgecenter/en/SSLVMB_sub/statistics_reference_project_ddita/spss/base/syn_date_and_time_date_time_formats.html ↩
"CEEDATM—Convert seconds to character timestamp". z/OS Language Environment Programming Reference. IBM. 2021-03-22. https://www.ibm.com/docs/en/zos/2.2.0?topic=services-ceedatmconvert-seconds-character-timestamp#clcdatm ↩
COBOL for AIX Programming Guide Version 5.1 (PDF) (First ed.). IBM. June 2015. CEEDATE—convert Lilian date to character format. SC27-5404-00. http://publibfp.boulder.ibm.com/epubs/pdf/c2754040.pdf ↩
Leach, P.; Mealling, M.; Salz, R. (July 2005). "RFC 4122: Proposed Standard: A Universally Unique IDentifier (UUID) URN Namespace". tools.ietf.org. Internet Engineering Task Force. https://tools.ietf.org/html/rfc4122 ↩
ISO/IEC 1989:2014 - Information technology — Programming languages, their environments and system software interfaces — Programming language COBOL. ISO. 2014-06-01. p. 634. https://www.iso.org/standard/51416.html ↩
Chen, Raymond (2009-03-06). "Why is the Win32 epoch January 1, 1601?". The Old New Thing. MSDN Blogs. /wiki/Raymond_Chen_(Microsoft) ↩
"FILETIME structure (minwinbase.h)". Microsoft Docs. https://learn.microsoft.com/en-us/windows/win32/api/minwinbase/ns-minwinbase-filetime ↩
"What happened in 1841?". M Technology and MUMPS Language FAQ, Part 1/2. Archived from the original on 2015-08-28. Retrieved 2015-08-14. https://web.archive.org/web/20150828234407/http://www.vmth.ucdavis.edu/m/m_faq1.htm ↩
Winkler, Gernot M. R. "Modified Julian Date". U.S. Naval Observatory. Archived from the original on 2013-02-14. Retrieved 2015-01-29. /wiki/Gernot_M._R._Winkler ↩
"VMS base time origin". vms.tuwien.ac.at/info/humour. Technische Universität Wien. Archived from the original on 2007-06-06. https://web.archive.org/web/20070606064704/http://vms.tuwien.ac.at/info/humour/vms-base-time-origin.txt ↩
"Introduction to the Google Sheets API". Google Developers. https://developers.google.com/sheets/guides/concepts#datetime_serial_numbers ↩
"International Day Number". help.dyalog.com. Retrieved 2018-11-27. http://help.dyalog.com/latest/Content/GUI/Miscellaneous/International%20Day%20Number.htm ↩
"Time Management". msdn.microsoft.com. https://msdn.microsoft.com/en-us/library/w4ddyt9h.aspx ↩
"What is story behind December 30, 1899 as base date?". social.msdn.microsoft.com.[permanent dead link] https://social.msdn.microsoft.com/Forums/office/en-US/f1eef5fe-ef5e-4ab6-9d92-0998d3fa6e14#360aa1df-ca93-45b9-b1fe-2e49f00f68e5 ↩
John Barnes. "7.3 Times and dates". Rationale for Ada 2005. Ada Resource Association. /wiki/John_Barnes_(computer_scientist) ↩
"Dates And Times In Excel". cpearson.com. http://www.cpearson.com/excel/datetime.htm ↩
"MacTech – The journal of Apple technology". mactech.com. http://www.mactech.com/articles/develop/issue_26/minow.html ↩
"Introduction to Dates and Times in SAS" (PDF). https://support.sas.com/content/dam/SAS/support/en/books/the-essential-guide-to-sas-dates-and-times/the-essential-guide-to-sas-dates-and-times-first-edition/59411_excerpt.pdf ↩
Mark Pick, International Spectrum Conference April 2010. ↩
"time_t – C++ Reference". Retrieved 2015-04-06. http://www.cplusplus.com/reference/ctime/time_t/ ↩
Barthel, Olaf (September 1998). "File: The Year 2000 Problem and the Amiga". amiga.de. https://amiga.de/diary/developers/y2k.html ↩
AmigaOS measures time in seconds and stores it in a signed 32 bit integer. After 19 January 2046, 03:14:07 the date will be negative. Latest OS version 4.1 (2016) has no fix for this. ↩
Levine, Judah (2002-07-05). "Time and frequency distribution using satellites" (PDF). Reports on Progress in Physics. 65 (8): 1119. Bibcode:2002RPPh...65.1119L. doi:10.1088/0034-4885/65/8/201 – via National Institute of Standards and Technology (NIST). http://tf.nist.gov/general/pdf/1602.pdf ↩
"Time Systems and Dates – GPS Time". Department of Oceanography, NPS. Naval Postgraduate School, Oceanography Department. Archived from the original on 2019-01-02. Retrieved 2019-02-18. https://web.archive.org/web/20190102012526/http://www.oc.nps.edu/oc2902w/gps/timsys.html ↩
"FIT SDK - Working with Date Time Values". garmin.com. 2023-01-01. Retrieved 2023-02-25. https://developer.garmin.com/fit/cookbook/datetime/ ↩
"Flexible and Interoperable Data Transfer - FIT Protocol". garmin.com. 2019-03-01. Retrieved 2023-02-25. https://developer.garmin.com/fit/protocol/ ↩
"AppleSingle/AppleDouble Formats for Foreign Files Developer's Note" (PDF). Archived from the original (PDF) on 2011-07-17. Retrieved 2007-10-23. https://web.archive.org/web/20110717032808/http://users.phg-online.de/tk/netatalk/doc/Apple/v2/AppleSingle_AppleDouble.pdf ↩
"PostgreSQL 9.1.24 Documentation. Chapter 8: Data Types. 8.5. Date/Time Types". PostgreSQL.org. 2016-10-27. Note: When timestamp values are stored as eight-byte integers (currently the default), microsecond precision is available over the full range of values. […] timestamp values are stored as seconds before or after midnight 2000-01-01. http://www.postgresql.org/docs/9.1/static/datatype-datetime.html ↩
Be aware that the Epoch function return the unix Epoch SELECT EXTRACT(EPOCH FROM TIMESTAMP WITH TIME ZONE '1970-01-01 00:00:00-00'); returns 0. ↩
"ZigBee Cluster Library Specification". Section 2.5.2.21 UTCTime. https://www.scribd.com/document/58909727/075366r01ZB-AFG-ZigBee-Cluster-Library-Public-Download-Version ↩
NASA JPL [@NASAJPL] (2021-05-04). "The Force is strong with this little one" (Tweet) – via Twitter. /wiki/Jet_Propulsion_Laboratory ↩
"NeoGPS/src/NeoTime.cpp at master · SlashDevin/NeoGPS". GitHub. Retrieved 2023-11-05. https://github.com/SlashDevin/NeoGPS/blob/master/src/NeoTime.cpp ↩