This is an old version, saved 4 Dec 2026, 17:27 by TechWritereditor. See the current version.
Unix time
Unix time is a way for computers to record a moment in time as a single number: the count of seconds since 00:00:00 Coordinated Universal Time (UTC) on 1 January 1970, a starting point known as the epoch.[1][3] It is used by Unix and systems derived from it, including Linux and macOS.[3]
History
The first edition of the Unix Programmer's Manual, dated 3 November 1971, measured time in sixtieths of a second since 1 January 1971 as a 32-bit quantity; its own list of bugs noted that this would run out after only about 2.5 years.[2] According to Dennis Ritchie's notes on the manual, the problem was handled by declaring new epochs, and in 1973 the unit became whole seconds counted from New Year 1970, which became the classic Unix epoch.[2]
How it works
Because the count has no notion of local time zones, the same number marks the same instant everywhere in the world.[1] In the C (programming language) library the value is held in a type called time_t, and the POSIX standard requires the count to leave out leap seconds.[1] The current POSIX standard, IEEE Std 1003.1-2024, defines functions such as mktime that convert calendar dates into this "time since the Epoch" and report an error when a date cannot be represented in a time_t.[5]
The year 2038 problem
Early Unix systems stored timestamps as signed 32-bit integers, which can hold at most 2,147,483,647 seconds; that limit is reached at 03:14:08 GMT on 19 January 2038.[3] Software can fail earlier, as soon as it handles a date beyond the limit, and a wrapped value is read as a date before 1970.[3] Modern systems use 64-bit counts, which last for about 292 billion years.[3] In 2020 the Linux kernel developers said that version 5.6 would be the first that could serve as a base for 32-bit systems designed to run beyond 2038, provided programs were rebuilt with a 64-bit time_t.[4]
See also
References
- ^ Simple Calendar Time (The GNU C Library manual). GNU Project. gnu.org
- ^ Unix Programmer's Manual, November 3, 1971. Nokia Bell Labs (Dennis M. Ritchie). nokia.com
- ^ Y2038: It's a Threat. Steven M. Bellovin, Columbia University. 2020-01-19. cs.columbia.edu
- ^ Need 32-bit Linux to run past 2038? When version 5.6 of the kernel pops, you're in for a treat. The Register. 2020-01-30. theregister.com
- ^ mktime — convert broken-down time into time since the Epoch. The Open Group / IEEE (IEEE Std 1003.1-2024). pubs.opengroup.org