<s>
The	O
year	B-Application
2038	I-Application
problem	I-Application
(	O
also	O
known	O
as	O
Y2038	B-Application
,	O
Y2K38	B-Application
,	O
Y2K38	B-Application
superbug	O
or	O
the	O
Epochalypse	B-Application
)	O
is	O
a	O
time	O
formatting	O
bug	O
in	O
computer	O
systems	O
with	O
representing	O
times	O
after	O
03:14:07	O
UTC	O
on	O
19January2038	O
.	O
</s>
<s>
The	O
problem	O
exists	O
in	O
systems	O
which	O
measure	O
Unix	B-Operating_System
time	I-Operating_System
–	O
the	O
number	O
of	O
seconds	O
elapsed	O
since	O
the	O
Unix	B-Operating_System
epoch	I-Operating_System
(	O
00:00:00	O
UTC	O
on	O
1January1970	O
)	O
–	O
and	O
store	O
it	O
in	O
a	O
signed	O
32-bit	O
integer	O
.	O
</s>
<s>
Attempting	O
to	O
increment	O
to	O
the	O
following	O
second	O
(	O
03:14:08	O
)	O
will	O
cause	O
the	O
integer	B-Error_Name
to	I-Error_Name
overflow	I-Error_Name
,	O
setting	O
its	O
value	O
to	O
−( 2	O
)	O
which	O
systems	O
will	O
interpret	O
as	O
2	O
seconds	O
before	O
epoch	O
(	O
20:45:52	O
UTC	O
on	O
13December1901	O
)	O
.	O
</s>
<s>
The	O
problem	O
is	O
similar	O
in	O
nature	O
to	O
the	O
year	B-Error_Name
2000	I-Error_Name
problem	I-Error_Name
.	O
</s>
<s>
Computer	O
systems	O
that	O
use	O
time	O
for	O
critical	O
computations	O
may	O
encounter	O
fatal	O
errors	O
if	O
the	O
Y2038	B-Application
problem	I-Application
is	O
not	O
addressed	O
.	O
</s>
<s>
The	O
most	O
vulnerable	O
systems	O
are	O
those	O
which	O
are	O
infrequently	O
or	O
never	O
updated	O
,	O
such	O
as	O
legacy	B-Device
and	O
embedded	B-Architecture
systems	I-Architecture
.	O
</s>
<s>
There	O
is	O
no	O
universal	O
solution	O
to	O
the	O
problem	O
,	O
though	O
many	O
modern	O
systems	O
have	O
been	O
upgraded	O
to	O
measure	O
Unix	B-Operating_System
time	I-Operating_System
with	O
signed	O
64-bit	B-Device
integers	O
which	O
will	O
not	O
overflow	B-Error_Name
for	O
292	O
billion	O
years	O
,	O
which	O
is	O
approximately	O
21	O
times	O
the	O
estimated	O
age	O
of	O
the	O
universe	O
.	O
</s>
<s>
Many	O
computer	O
systems	O
measure	O
time	O
and	O
date	O
as	O
Unix	B-Operating_System
time	I-Operating_System
,	O
an	O
international	O
standard	O
for	O
digital	O
timekeeping	O
.	O
</s>
<s>
Unix	B-Operating_System
time	I-Operating_System
is	O
defined	O
as	O
the	O
number	O
of	O
seconds	O
elapsed	O
since	O
00:00:00	O
UTC	O
on	O
1	B-Operating_System
January	I-Operating_System
1970	I-Operating_System
(	O
an	O
arbitrarily	O
chosen	O
time	O
)	O
,	O
which	O
has	O
been	O
dubbed	O
the	O
Unix	B-Operating_System
epoch	I-Operating_System
.	O
</s>
<s>
Unix	B-Operating_System
time	I-Operating_System
has	O
historically	O
been	O
encoded	O
as	O
a	O
signed	O
32-bit	O
integer	O
,	O
a	O
data	O
type	O
composed	O
of	O
32	O
binary	O
digits	O
(	O
bits	O
)	O
which	O
represent	O
an	O
integer	O
value	O
,	O
with	O
'	O
signed	O
 '	O
meaning	O
that	O
the	O
number	O
is	O
stored	O
in	O
Two	B-General_Concept
's	I-General_Concept
complement	I-General_Concept
format	O
.	O
</s>
<s>
Consequently	O
,	O
if	O
a	O
signed	O
32-bit	O
integer	O
is	O
used	O
to	O
store	O
Unix	B-Operating_System
time	I-Operating_System
,	O
the	O
latest	O
time	O
that	O
can	O
be	O
stored	O
is	O
231	O
−	O
1	O
(	O
2,147,483,647	O
)	O
seconds	O
after	O
epoch	O
,	O
which	O
is	O
.	O
</s>
<s>
Systems	O
that	O
attempt	O
to	O
increment	O
this	O
value	O
by	O
one	O
more	O
second	O
to	O
2	O
seconds	O
after	O
epoch	O
(	O
03:14:08	O
)	O
will	O
suffer	O
integer	B-Error_Name
overflow	I-Error_Name
,	O
inadvertently	O
flipping	O
the	O
sign	O
bit	O
to	O
indicate	O
a	O
negative	O
number	O
.	O
</s>
<s>
Any	O
system	O
using	O
data	B-General_Concept
structures	I-General_Concept
with	O
32-bit	O
time	O
representations	O
has	O
an	O
inherent	O
risk	O
to	O
fail	O
.	O
</s>
<s>
A	O
full	O
list	O
of	O
these	O
data	B-General_Concept
structures	I-General_Concept
is	O
virtually	O
impossible	O
to	O
derive	O
,	O
but	O
there	O
are	O
well-known	O
data	B-General_Concept
structures	I-General_Concept
that	O
have	O
the	O
Unix	B-Operating_System
time	I-Operating_System
problem	O
:	O
</s>
<s>
Embedded	B-Architecture
systems	I-Architecture
that	O
use	O
dates	O
for	O
either	O
computation	O
or	O
diagnostic	O
logging	O
are	O
most	O
likely	O
to	O
be	O
affected	O
by	O
the	O
Y2038	B-Application
problem	I-Application
.	O
</s>
<s>
Despite	O
the	O
modern	O
18	O
–	O
24	O
month	O
generational	O
update	O
in	O
computer	O
systems	O
technology	O
,	O
embedded	B-Architecture
systems	I-Architecture
are	O
designed	O
to	O
last	O
the	O
lifetime	O
of	O
the	O
machine	O
in	O
which	O
they	O
are	O
a	O
component	O
.	O
</s>
<s>
Many	O
transportation	O
systems	O
from	O
flight	O
to	O
automobiles	O
use	O
embedded	B-Architecture
systems	I-Architecture
extensively	O
.	O
</s>
<s>
Another	O
major	O
use	O
of	O
embedded	B-Architecture
systems	I-Architecture
is	O
in	O
communications	O
devices	O
,	O
including	O
cell	O
phones	O
and	O
Internet-enabled	O
appliances	O
(	O
e.g.	O
</s>
<s>
routers	B-Protocol
,	O
wireless	B-Device
access	I-Device
points	I-Device
,	O
IP	B-Algorithm
cameras	I-Algorithm
)	O
which	O
rely	O
on	O
storing	O
an	O
accurate	O
time	O
and	O
date	O
and	O
are	O
increasingly	O
based	O
on	O
Unix-like	O
operating	O
systems	O
.	O
</s>
<s>
For	O
example	O
,	O
the	O
Y2038	B-Application
problem	I-Application
makes	O
some	O
devices	O
running	O
32-bit	O
Android	B-Application
crash	O
and	O
not	O
restart	O
when	O
the	O
time	O
is	O
changed	O
to	O
that	O
date	O
.	O
</s>
<s>
However	O
,	O
this	O
does	O
not	O
imply	O
that	O
all	O
embedded	B-Architecture
systems	I-Architecture
will	O
suffer	O
from	O
the	O
Y2038	B-Application
problem	I-Application
,	O
since	O
many	O
such	O
systems	O
do	O
not	O
require	O
access	O
to	O
dates	O
.	O
</s>
<s>
In	O
May	O
2006	O
,	O
reports	O
surfaced	O
of	O
an	O
early	O
manifestation	O
of	O
the	O
Y2038	B-Application
problem	I-Application
in	O
the	O
AOLserver	B-Language
software	O
.	O
</s>
<s>
The	O
software	O
was	O
designed	O
with	O
a	O
kludge	B-Architecture
to	O
handle	O
a	O
database	O
request	O
that	O
should	O
"	O
never	O
"	O
time	O
out	O
.	O
</s>
<s>
When	O
the	O
problem	O
was	O
discovered	O
,	O
AOLServer	B-Language
operators	O
had	O
to	O
edit	O
the	O
configuration	O
file	O
and	O
set	O
the	O
time-out	O
to	O
a	O
lower	O
value	O
.	O
</s>
<s>
There	O
is	O
no	O
universal	O
solution	O
for	O
the	O
Year	B-Application
2038	I-Application
problem	I-Application
.	I-Application
</s>
<s>
For	O
example	O
,	O
in	O
the	O
C	B-Language
language	I-Language
,	O
any	O
change	O
to	O
the	O
definition	O
of	O
the	O
time_t	O
data	O
type	O
would	O
result	O
in	O
code-compatibility	B-General_Concept
problems	O
in	O
any	O
application	O
in	O
which	O
date	O
and	O
time	O
representations	O
are	O
dependent	O
on	O
the	O
nature	O
of	O
the	O
signed	O
32-bit	O
time_t	O
integer	O
.	O
</s>
<s>
Increasing	O
the	O
size	O
of	O
the	O
time_t	O
type	O
to	O
64	B-Device
bits	I-Device
in	O
an	O
existing	O
system	O
would	O
cause	O
incompatible	O
changes	O
to	O
the	O
layout	O
of	O
structures	O
and	O
the	O
binary	O
interface	O
of	O
functions	O
.	O
</s>
<s>
Most	O
operating	O
systems	O
designed	O
to	O
run	O
on	O
64-bit	B-Device
hardware	O
already	O
use	O
signed	O
64-bit	B-Device
time_t	O
integers	O
.	O
</s>
<s>
Using	O
a	O
signed	O
64-bit	B-Device
value	O
introduces	O
a	O
new	O
wraparound	O
date	O
that	O
is	O
over	O
twenty	O
times	O
greater	O
than	O
the	O
estimated	O
age	O
of	O
the	O
universe	O
:	O
approximately	O
292billion	O
years	O
from	O
now	O
.	O
</s>
<s>
Alternative	O
proposals	O
have	O
been	O
made	O
(	O
some	O
of	O
which	O
are	O
already	O
in	O
use	O
)	O
,	O
such	O
as	O
storing	O
either	O
milliseconds	O
or	O
microseconds	O
since	O
an	O
epoch	O
(	O
typically	O
either	O
1	B-Operating_System
January	I-Operating_System
1970	I-Operating_System
or	O
1	O
January	O
2000	O
)	O
in	O
a	O
signed	O
64-bit	B-Device
integer	O
,	O
providing	O
a	O
minimum	O
range	O
of	O
300,000	O
years	O
at	O
microsecond	O
resolution	O
.	O
</s>
<s>
In	O
particular	O
,	O
Java	O
's	O
use	O
of	O
64-bit	B-Device
long	O
integers	O
everywhere	O
to	O
represent	O
time	O
as	O
"	O
milliseconds	O
since	O
1	B-Operating_System
January	I-Operating_System
1970	I-Operating_System
"	O
will	O
work	O
correctly	O
for	O
the	O
next	O
292	O
million	O
years	O
.	O
</s>
<s>
Starting	O
with	O
Ruby	B-Language
version	O
1.9.2	O
,	O
the	O
bug	O
with	O
year	O
2038	O
is	O
fixed	O
,	O
by	O
re-implementing	O
time	O
to	O
have	O
no	O
minimum	O
or	O
maximum	O
.	O
</s>
<s>
Starting	O
with	O
NetBSD	B-Device
version	O
6.0	O
(	O
released	O
in	O
October	O
2012	O
)	O
,	O
the	O
NetBSD	B-Device
operating	O
system	O
uses	O
a	O
64-bit	B-Device
time_t	O
for	O
both	O
32-bit	O
and	O
64-bit	B-Device
architectures	I-Device
.	O
</s>
<s>
Applications	O
that	O
were	O
compiled	O
for	O
an	O
older	O
NetBSD	B-Device
release	O
with	O
32-bit	O
time_t	O
are	O
supported	O
via	O
a	O
binary	B-General_Concept
compatibility	I-General_Concept
layer	O
,	O
but	O
such	O
older	O
applications	O
will	O
still	O
suffer	O
from	O
the	O
Y2038	B-Application
problem	I-Application
.	O
</s>
<s>
OpenBSD	B-Operating_System
since	O
version	O
5.5	O
,	O
released	O
in	O
May	O
2014	O
,	O
also	O
uses	O
a	O
64-bit	B-Device
time_t	O
for	O
both	O
32-bit	O
and	O
64-bit	B-Device
architectures	I-Device
.	O
</s>
<s>
In	O
contrast	O
to	O
NetBSD	B-Device
,	O
there	O
is	O
no	O
binary	B-General_Concept
compatibility	I-General_Concept
layer	O
.	O
</s>
<s>
Linux	B-Application
originally	O
used	O
a	O
64-bit	B-Device
time_t	O
for	O
64-bit	B-Device
architectures	I-Device
only	O
;	O
the	O
pure	O
32-bit	O
ABI	B-Operating_System
was	O
not	O
changed	O
due	O
to	O
backward	O
compatibility	O
.	O
</s>
<s>
Starting	O
with	O
version	O
5.6	O
of	O
2020	O
,	O
64-bit	B-Device
time_t	O
is	O
supported	O
on	O
32-bit	O
architectures	O
,	O
too	O
.	O
</s>
<s>
This	O
was	O
done	O
primarily	O
for	O
the	O
sake	O
of	O
embedded	B-Application
Linux	I-Application
systems	O
.	O
</s>
<s>
FreeBSD	B-Operating_System
uses	O
64-bit	B-Device
time_t	O
for	O
all	O
32-bit	O
and	O
64-bit	B-Device
architectures	I-Device
except	O
32-bit	O
i386	O
,	O
which	O
uses	O
signed	O
32-bit	O
time_t	O
instead	O
.	O
</s>
<s>
The	O
x32	B-Application
ABI	I-Application
for	O
Linux	B-Application
(	O
which	O
defines	O
an	O
environment	O
for	O
programs	O
with	O
32-bit	O
addresses	O
but	O
running	O
the	O
processor	O
in	O
64-bit	B-Device
mode	O
)	O
uses	O
a	O
64-bit	B-Device
time_t	O
.	O
</s>
<s>
Network	B-Protocol
File	I-Protocol
System	I-Protocol
version	O
4	O
has	O
defined	O
its	O
time	O
fields	O
as	O
struct	O
nfstime4	O
{	O
int64_t	O
seconds	O
;	O
uint32_t	O
nseconds	O
;}	O
since	O
December	O
2000	O
.	O
</s>
<s>
Values	O
greater	O
than	O
zero	O
for	O
the	O
seconds	O
field	O
denote	O
dates	O
after	O
the	O
0-hour	O
,	O
January	B-Operating_System
1	I-Operating_System
,	I-Operating_System
1970	I-Operating_System
.	O
</s>
<s>
Values	O
less	O
than	O
zero	O
for	O
the	O
seconds	O
field	O
denote	O
dates	O
before	O
the	O
0-hour	O
,	O
January	B-Operating_System
1	I-Operating_System
,	I-Operating_System
1970	I-Operating_System
.	O
</s>
<s>
The	O
ext4	B-Application
filesystem	I-Application
,	O
when	O
used	O
with	O
inode	B-Application
sizes	O
larger	O
than	O
128	O
bytes	O
,	O
has	O
an	O
extra	O
32-bit	O
field	O
per	O
timestamp	O
,	O
of	O
which	O
30	O
bits	O
are	O
used	O
for	O
the	O
nanoseconds	O
part	O
of	O
the	O
timestamp	O
,	O
and	O
the	O
other	O
2	O
bits	O
are	O
used	O
to	O
extend	O
the	O
timestamp	O
range	O
to	O
the	O
year	O
2446	O
.	O
</s>
<s>
The	O
XFS	B-Application
filesystem	O
,	O
starting	O
with	O
Linux	B-Application
5.10	O
,	O
has	O
an	O
optional	O
"	O
big	O
timestamps	O
"	O
feature	O
which	O
extends	O
the	O
timestamp	O
range	O
to	O
the	O
year	O
2486	O
.	O
</s>
<s>
While	O
the	O
native	O
APIs	O
of	O
OpenVMS	B-Operating_System
can	O
support	O
timestamps	O
up	O
to	O
31	O
July	O
31086	O
,	O
the	O
C	B-Language
runtime	O
library	O
(	O
CRTL	O
)	O
uses	O
32-bit	O
integers	O
for	O
time_t	O
.	O
</s>
<s>
As	O
part	O
of	O
Y2K	B-Error_Name
compliance	O
work	O
that	O
was	O
carried	O
out	O
in	O
1998	O
,	O
the	O
CRTL	O
was	O
modified	O
to	O
use	O
unsigned	O
32-bit	O
integers	O
to	O
represent	O
time	O
;	O
extending	O
the	O
range	O
of	O
time_t	O
up	O
to	O
7	O
February	O
2106	O
.	O
</s>
<s>
As	O
of	O
MySQL	B-Application
8.0.28	O
,	O
the	O
functions	O
FROM_UNIXTIME( )	O
,	O
UNIX_TIMESTAMP( )	O
,	O
and	O
CONVERT_TZ( )	O
handle	O
64-bit	B-Device
values	O
on	O
platforms	O
that	O
support	O
them	O
.	O
</s>
<s>
This	O
includes	O
64-bit	B-Device
versions	O
of	O
Linux	B-Application
,	O
MacOS	O
,	O
and	O
Windows	O
.	O
</s>
