An animated visual of the bug in action. The overflow error will occur at 03:14:08 UTC on 19 January 2038.

The year 2038 problem (also known as Y2038,[1] Y2K38, Y2K38 superbug or the Epochalypse[2][3]) is a time computing problem that leaves some computer systems unable to represent times after 03:14:07 UTC on 19 January 2038.

The problem exists in systems which measure Unix time—the number of seconds elapsed since the Unix epoch (00:00:00 UTC on 1 January 1970)—and store it in a signed 32-bit integer. The data type is only capable of representing integers between −(231) and 231 − 1, meaning the latest time that can be properly encoded is 231 − 1 seconds after epoch (03:14:07 UTC on 19 January 2038). Attempting to increment to the following second (03:14:08) will cause the integer to overflow, setting its value to −(231) which systems will interpret as 231 seconds before epoch (20:45:52 UTC on 13 December 1901). The problem is similar in nature to the year 2000 problem. Analogous storage constraints for unsigned 32-bit integers will be reached in 2106.

Computer systems that use time for critical computations may encounter fatal errors if the year 2038 problem is not addressed. Some applications that use future dates have already encountered the bug.[4][5] The most vulnerable systems are those which are infrequently or never updated, such as legacy and embedded systems. To address the problem, many modern systems have been upgraded to measure Unix time with signed 64-bit integers instead, which will take 292 billion years to overflow—approximately 21 times the estimated age of the universe.


Many computer systems measure time and date as Unix time, an international standard for digital timekeeping. Unix time is defined as the number of seconds elapsed since 00:00:00 UTC on 1 January 1970 (an arbitrarily chosen time based on the creation of the first Unix system), which has been dubbed the Unix epoch.[6]

Unix time has historically been encoded as a signed 32-bit integer, a data type composed of 32 binary digits (bits) which represent an integer value, with 'signed' meaning that the number can represent both positive and negative numbers, as well as zero; and is usually stored in two's complement format.[a] Thus, a signed 32-bit integer can only represent integer values from −(231) to 231 − 1 inclusive. Consequently, if a signed 32-bit integer is used to store Unix time, the latest time that can be stored is 231 − 1 (2,147,483,647) seconds after epoch, which is 03:14:07 on Tuesday, 19 January 2038.[7] Systems that attempt to increment this value by one more second to 231 seconds after epoch (03:14:08) will suffer integer overflow, inadvertently flipping the sign bit to indicate a negative number. This changes the integer value to −(231), or 231 seconds before epoch rather than after, which systems will interpret as 20:45:52 on Friday, 13 December 1901. From here, systems will continue to count up, toward zero, and then up through the positive integers again. As many computer systems use time computations to run critical functions, the bug may introduce fatal errors.

Vulnerable systems

Any system using data structures with signed 32-bit time representations has an inherent risk to fail. A full list of these data structures is virtually impossible to derive, but there are well-known data structures that have the Unix time problem:

Embedded systems

Embedded systems that use dates for either computation or diagnostic logging are most likely to be affected by the Y2038 problem.[1] Despite the modern 18–24 month generational update in computer systems technology, embedded systems are designed to last the lifetime of the machine in which they are a component. It is conceivable that some of these systems may still be in use in 2038. It may be impractical or, in some cases, impossible to upgrade the software running these systems, ultimately requiring replacement if the 32-bit limitations are to be corrected.

Many transportation systems from flight to automobiles use embedded systems extensively. In automotive systems, this may include anti-lock braking system (ABS), electronic stability control (ESC/ESP), traction control (TCS) and automatic four-wheel drive; aircraft may use inertial guidance systems and GPS receivers.[b] Another major use of embedded systems is in communications devices, including cell phones and Internet-enabled appliances (e.g. routers, wireless access points, IP cameras) which rely on storing an accurate time and date and are increasingly based on Unix-like operating systems. For example, the Y2038 problem makes some devices running 32-bit Android crash and not restart when the time is changed to that date.[8]

However, this does not imply that all embedded systems will suffer from the Y2038 problem, since many such systems do not require access to dates. For those that do, those systems which only track the difference between times/dates and not absolute times/dates will, by the nature of the calculation, not experience a major problem. This is the case for automotive diagnostics based on legislated standards such as CARB (California Air Resources Board).[9]

Early problems

In May 2006, reports surfaced of an early manifestation of the Y2038 problem in the AOLserver software. The software was designed with a kludge to handle a database request that should "never" time out. Rather than specifically handling this special case, the initial design simply specified an arbitrary time-out date in the future. The default configuration for the server specified that the request should time out after one billion seconds. One billion seconds (approximately 32 years) after 01:27:28 UTC on 13 May 2006 is beyond the 2038 cutoff date. Thus, after this time, the time-out calculation overflowed and returned a date that was actually in the past, causing the software to crash. When the problem was discovered, AOLServer operators had to edit the configuration file and set the time-out to a lower value.[4][5]


There is no universal solution for the Year 2038 problem. For example, in the C language, any change to the definition of the time_t data type would result in code-compatibility problems in any application in which date and time representations are dependent on the nature of the signed 32-bit time_t integer. For example, changing time_t to an unsigned 32-bit integer, which would extend the range to 2106[10] (specifically, 06:28:15 UTC on Sunday, 7 February 2106), would adversely affect programs that store, retrieve, or manipulate dates prior to 1970, as such dates are represented by negative numbers. Increasing the size of the time_t type to 64 bits in an existing system would cause incompatible changes to the layout of structures and the binary interface of functions.

Most operating systems designed to run on 64-bit hardware already use signed 64-bit time_t integers. Using a signed 64-bit value introduces a new wraparound date that is over twenty times greater than the estimated age of the universe: approximately 292 billion years from now.[11] The ability to make computations on dates is limited by the fact that tm_year uses a signed 32-bit integer value starting at 1900 for the year. This limits the year to a maximum of 2,147,485,547 (2,147,483,647 + 1900).[12]

Alternative proposals have been made (some of which are already in use), such as storing either milliseconds or microseconds since an epoch (typically either 1 January 1970 or 1 January 2000) in a signed 64-bit integer, providing a minimum range of 300,000 years at microsecond resolution.[13][14] In particular, Java's use of 64-bit long integers everywhere to represent time as "milliseconds since 1 January 1970" will work correctly for the next 292 million years. Other proposals for new time representations provide different precisions, ranges, and sizes (almost always wider than 32 bits), as well as solving other related problems, such as the handling of leap seconds. In particular, TAI64[15] is an implementation of the International Atomic Time (TAI) standard, the current international real-time standard for defining a second and frame of reference.

Implemented solutions

See also


  1. ^ Unless otherwise specified, all the numbers provided in this article have been derived using two's complement for signed integer arithmetic.
  2. ^ GPS suffers its own time counter overflow problem known as GPS Week Number Rollover.


  1. ^ a b "Is the Year 2038 problem the new Y2K bug?". The Guardian. 17 December 2014. Retrieved 11 October 2018.
  2. ^ Bergmann, Arnd (6 February 2020). "The end of an Era". Linaro.
  3. ^ Wagenseil, Paul (28 July 2017). "Digital 'Epochalypse' Could Bring World to Grinding Halt". Tom's Guide.
  4. ^ a b "The Future Lies Ahead". 28 June 2006. Retrieved 19 November 2006.
  5. ^ a b Weird "memory leak" problem in AOLserver 3.4.2/3.x 12 May 2006
  6. ^ "Epoch Time". unixtutoria. 15 March 2019. Retrieved 13 April 2023.
  7. ^ Diomidis Spinellis (2006). Code quality: the open source perspective. Effective software development series in Safari Books Online (illustrated ed.). Adobe Press. p. 49. ISBN 978-0-321-16607-4.
  8. ^ "ZTE Blade running Android 2.2 has 2038 problems". Retrieved 20 November 2018.
  9. ^ "ARB Test Methods / Procedures". California Air Resources Board. Archived from the original on 18 November 2016. Retrieved 12 September 2013.
  10. ^ "DRAFT: Y2038 Proofness Design". Retrieved 25 May 2024.
  11. ^ "When does the 64-bit Unix time_t really end?". Retrieved 24 September 2022.
  12. ^ Felts, Bob (17 April 2010). "The End of Time". Retrieved 19 March 2012.
  13. ^ "Unununium Time". Archived from the original on 8 April 2006. Retrieved 19 November 2006.
  14. ^ Sun Microsystems. "Java API documentation for System.currentTimeMillis()". Retrieved 29 September 2017.
  15. ^ "TAI64".
  16. ^ "Ruby 1.9.2 is released". 18 August 2010. Retrieved 1 April 2022.
  17. ^ "time.c: use 64bit arithmetic even on platforms with 32bit VALUE". GitHub.
  18. ^ "Announcing NetBSD 6.0". 17 October 2012. Retrieved 18 January 2016.
  19. ^ "OpenBSD 5.5 released (May 1, 2014)". 1 May 2014. Retrieved 18 January 2016.
  20. ^ a b Jonathan Corbet (14 August 2013). "Pondering 2038". Archived from the original on 4 March 2016. Retrieved 9 March 2016.
  21. ^ "LKML: Arnd Bergmann: [GIT PULL] y2038: core, driver and file system changes". Retrieved 30 January 2020.
  22. ^ O'Donell, Carlos (2 August 2021). "The GNU C Library version 2.34 is now available". Sourceware. Retrieved 30 April 2024.
  23. ^ "arch".
  24. ^ Haynes, Thomas; Noveck, David, eds. (March 2015). "Structured Data Types". Network File System (NFS) Version 4 Protocol. sec. 2.2. doi:10.17487/RFC7530. RFC 7530.
  25. ^ Staubach, Peter; Pawlowski, Brian; Callaghan, Brent (June 1995). "NFS Version 3 Protocol Specification". Retrieved 25 May 2024.
  26. ^ "ext4 Data Structures and Algorithms". Retrieved 13 September 2022.
  27. ^ Michael Larabel (15 October 2020). "XFS File-System With Linux 5.10 Punts Year 2038 Problem To The Year 2486". Phoronix. Retrieved 13 September 2022.
  28. ^ "Why is Wednesday, November 17, 1858 the base time for OpenVMS (VAX VMS)?". Stanford University. 24 July 1997. Archived from the original on 24 July 1997. Retrieved 8 January 2020.
  29. ^ "VSI C Run-Time Library Reference Manual for OpenVMS Systems" (PDF). VSI. November 2020. Archived from the original (PDF) on 17 April 2021. Retrieved 17 April 2021.
  30. ^ "OpenVMS and the year 2038". HP. Retrieved 17 April 2021.
  31. ^ "PostgreSQL Release 7.2". January 2012. Retrieved 25 April 2024.
  32. ^ "What Is New in MySQL 8.0".
  33. ^ "Changes in MySQL 8.0.28 (2022-01-18, General Availability)".
  34. ^ "MySQL Bugs: #12654: 64-bit unix timestamp is not supported in MySQL functions".