ArticleslgStudy

computer science

Year 2038 problem

Year 2038 problem is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Year 2038 problem rather than just read about it. In short: The year 2038 problem (also known as Y2038, Y2K38, or the Epochalypse) 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.

Year 2038 problem — main illustration
Year 2038 problem — illustration

Key takeaways

  • Year 2038 problem belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Year 2038 problem to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Year 2038 problem from memory before moving on to harder problems.

Reference excerpt

The year 2038 problem (also known as Y2038, Y2K38, or the Epochalypse) 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. When the data type's maximum value is exceeded, the integer will overflow to its minimum value, which systems will interpret as in the past. The problem resembles the year 2000 problem, which was caused by use of a fixed-width decimal (base-10) representation, whereas the year 2038 problem is caused by use of a fixed-width binary (base-2) representation. 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. The most vulnerable systems are those which are infrequently or never updated, such as legacy and embedded systems. Modern systems and software updates address this problem by using signed 64-bit integers, which will take 292 billion years to overflow—approximately 21 times the estimated current age of the universe.

Cause Many computer systems measure time and date using Unix time, an international standard for digital timekeeping. Unix time is defined as the number of seconds elapsed, ignoring leap seconds, since 00:00:00 UTC on 1 January 1970, known as the Unix epoch. 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. 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 UTC on 19 January 2038. 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 UTC on 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 serious problems.

Vulnerable systems Any system using data structures with signed 32-bit time representations has an inherent risk of failing. 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:

File systems that use 32 bits to represent times in inodes, such as ext2, ext3, and reiserFS. Databases with 32-bit time fields. Database query languages (such as SQL) that have UNIX_TIMESTAMP()-like commands. Many 32-bit Android devices on Android 4 or earlier, including ZTE Blade, Google Nexus 7 and 2012 Toshiba Android tablets. OS X-era PowerPC Macs will have their system clock get stuck on the rollover time as of Mac OS X Tiger. 32-bit iOS devices as of iPhone 5 on circa iOS 9 will be unable to unlock or to consistently enter charging mode, and the lockscreen clock will not show up. As of circa Windows 10 version 22H2, if an x86 (32-bit) device has not been turned on at the rollover point, but is started up after the rollover, the system clock can skip ahead to 12 April 2160, and the date options in Windows 10's main settings menu does not show any selectable numbers. Software built with Visual Studio has the _gmtime32 format (which serves as a mapping of time_t's 32-bit version) roll over at 19 January 2038 00:00:00. Software built with pre-2005 versions of Visual Studio were known to have _gmtime correspond to _gmtime32, and the correspondence can be forced when building with 32-bit versions of Visual Studio through Visual Studio 2019 by specifying _USE_32BIT_TIME_T.

Embedded systems Embedded systems that use dates for either computation or diagnostic logging are most likely to be affected by the Y2038 problem. 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 difficult 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. 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. 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 problem for automotive diagnostics based on legislated standards such as CARB (California Air Resources Board).

… excerpt ends here. Continue reading the full article.

Illustrations

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

Worked examples

Example 1 — a first encounter with Year 2038 problem

Start with the simplest possible case. Write down what Year 2038 problem claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Year 2038 problem before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Year 2038 problem ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Year 2038 problem

In research
Year 2038 problem appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Year 2038 problem in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Year 2038 problem is common in secondary-school and first-year university syllabi. It links to neighbouring topics 2038, Future problems, Linux, so understanding it makes those chapters shorter.
In everyday life
Look for Year 2038 problem outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Year 2038 problem” →

How to study Year 2038 problem in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Year 2038 problem means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Year 2038 problem out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Year 2038 problem in simple terms?

The year 2038 problem (also known as Y2038, Y2K38, or the Epochalypse) 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 ep…

Why does Year 2038 problem matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Year 2038 problem?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Year 2038 problem.

Tags

  • 2038
  • Future problems
  • Linux
  • Operating system technology
  • Software bugs
  • Time formatting and storage bugs
  • Unix

Keep exploring