The Y2038 bug
CMAP (Centre de Mathématiques APpliquées) UMR CNRS 7641, École polytechnique, Institut Polytechnique de Paris, CNRS, France
[Site Map, Help and Search [Plan du Site, Aide et Recherche]]
[The Y2K Bug [Le bug de l'an 2000]]
[Real Numbers don't exist in Computers and Floating Point Computations aren't safe. [Les Nombres Réels n'existent pas dans les Ordinateurs et les Calculs Flottants ne sont pas sûrs.]]
[Please, visit A Virtual Machine for Exploring Space-Time and Beyond, the place where you can find more than 10.000 pictures and animations between Art and Science]
(CMAP28 WWW site: this page was created on 03/07/2026 and last updated on 03/11/2026 18:29:08 -CET-)
[en français/in french]
Did the Year 2000 bug teach us anything, and are we ready for the year 2038?
As I had already pointed out before the year 2000,
some UNIX/Linux systems could be affected by a "new" date problem on January 19, 2038 at 03:14:07 UTC.
Indeed, all UNIX/Linux systems measure
the passage of time using a counter that records the number of seconds elapsed since January 1,
1970 at 00:00:00 UTC (Universal Coordinated Time).
This counter is a signed integer of type time_t.
Originally it used 32 bits (which at the time seemed more than sufficient!). However, the Year
2000 bug helped raise awareness about time-related problems in computers. With only 32 bits,
on January 19, 2038 at 03:14:07 UTC, this counter should switch from 0x7fffffff to 0x80000000,
which is a negative value.
It appears that this anomaly has been corrected in all modern systems by
expanding the counter from 32 bits to 64 bits, which is now more than sufficient to look toward
the future with confidence. Nevertheless, many older computers are still in operation,
particularly so-called embedded systems. Making a complete inventory of them seems to be an impossible task.
This small program:
/*************************************************************************************************************************************/
/* */
/* T E S T D U B U G D E L ' A N 2 0 3 8: */
/* */
/* */
/* Author of '$xtc/An2038.01$c': */
/* */
/* Jean-Francois COLONNA (LACTAMME, 20260309090718). */
/* */
/*************************************************************************************************************************************/
#include <stdio.h>
#include <time.h>
void main()
{
int longueur=sizeof(time_t);
if (longueur == sizeof(int))
{
printf("La longueur du type 'time_t' est de %d : le bug de l'an 2038 est present.\n",longueur);
}
else
{
if (longueur == sizeof(long int))
{
printf("La longueur du type 'time_t' est de %d : ce systeme est pret pour l'an 2038.\n",longueur);
}
else
{
printf("La longueur du type 'time_t' est de %d : pourquoi ?\n",longueur);
}
}
}
makes it possible to test any computer running Linux by compiling it and then executing it...
Thus, we are once again confronted with a non-linear problem: small causes, large effects!
Copyright © Jean-François COLONNA, 2026-2026.
Copyright © CMAP (Centre de Mathématiques APpliquées) UMR CNRS 7641 / École polytechnique, Institut Polytechnique de Paris, 2026-2026.