Jump to content

Year 2038 problem: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
Undid revision 225660648 by 35.13.21.101 (talk) - Yes, a citation is still needed.
SmackBot (talk | contribs)
m Date the maintenance tags or general fixes
Line 14: Line 14:
| doi =
| doi =
| accessdate = 2008-03-07
| accessdate = 2008-03-07
| quote = }}</ref> This representation also affects software written for most other operating systems because of the broad deployment of [[C (programming language)|C]]. On most 32-bit systems, the <code>[[time_t]]</code> data type used to store this second count is a [[signedness|signed]] [[32-bit]] [[integer (computer science)|integer]]. The latest time that can be represented in this format, following the [[POSIX]] standard, is 03:14:07 [[Coordinated Universal Time|UTC]] on Tuesday, [[January 19]], [[2038]]. Times beyond this moment will "wrap around" and be represented internally as a negative number, and cause programs to fail, since they will see these times as being not in 2038, but rather in 1901. Erroneous calculations and decisions may therefore result.
| quote = }}</ref> This representation also affects software written for most other operating systems because of the broad deployment of [[C (programming language)|C]]. On most 32-bit systems, the <code>[[time t]]</code> data type used to store this second count is a [[signedness|signed]] [[32-bit]] [[integer (computer science)|integer]]. The latest time that can be represented in this format, following the [[POSIX]] standard, is 03:14:07 [[Coordinated Universal Time|UTC]] on Tuesday, [[January 19]], [[2038]]. Times beyond this moment will "wrap around" and be represented internally as a negative number, and cause programs to fail, since they will see these times as being not in 2038, but rather in 1901. Erroneous calculations and decisions may therefore result.


==Known problems==
==Known problems==
Line 32: Line 32:
There is no easy fix for this problem for existing [[central processing unit|CPU]]/[[operating system|OS]]/[[File System]] combinations. Changing the definition of <code>time_t</code> to use a 64-bit type would break binary compatibility for software, data storage, and generally anything dealing with the binary representation of time. Changing <code>time_t</code> to an unsigned 32-bit integer, effectively allowing timestamps to be accurate until the year 2106, would affect many programs that deal with time differences, and thus also break binary compatibility in many cases.
There is no easy fix for this problem for existing [[central processing unit|CPU]]/[[operating system|OS]]/[[File System]] combinations. Changing the definition of <code>time_t</code> to use a 64-bit type would break binary compatibility for software, data storage, and generally anything dealing with the binary representation of time. Changing <code>time_t</code> to an unsigned 32-bit integer, effectively allowing timestamps to be accurate until the year 2106, would affect many programs that deal with time differences, and thus also break binary compatibility in many cases.


Most operating systems for [[64-bit]] [[hardware architecture|architecture]]s already use 64-bit integers in their <code>time_t</code>. The move to these architectures is already under way and many expect it to be complete before 2038. Using a (signed) 64-bit value introduces a new wraparound date in about 290 billion years, on Sunday, December 4, [[11th millennium and beyond#Technology|292,277,026,596]]. This problem, however, is not widely regarded as a pressing issue.{{cn}} As of 2007, however, hundreds of millions of 32-bit systems are deployed, many in [[embedded system]]s, and it is far from certain they will all be replaced by 2038.
Most operating systems for [[64-bit]] [[hardware architecture|architecture]]s already use 64-bit integers in their <code>time_t</code>. The move to these architectures is already under way and many expect it to be complete before 2038. Using a (signed) 64-bit value introduces a new wraparound date in about 290 billion years, on Sunday, December 4, [[11th millennium and beyond#Technology|292,277,026,596]]. This problem, however, is not widely regarded as a pressing issue.{{Fact|date=July 2008}} As of 2007, however, hundreds of millions of 32-bit systems are deployed, many in [[embedded system]]s, and it is far from certain they will all be replaced by 2038.


Despite the modern 18- to 24-month generational update in computer systems technology, embedded computers may operate unchanged for the life of the system they control. The use of 32-bit <code>time_t</code> has also been encoded into some file formats, which means it can live on for a long time beyond the life of the machines involved.
Despite the modern 18- to 24-month generational update in computer systems technology, embedded computers may operate unchanged for the life of the system they control. The use of 32-bit <code>time_t</code> has also been encoded into some file formats, which means it can live on for a long time beyond the life of the machines involved.


A variety of alternative proposals have been made, some of which are in use, including storing either [[millisecond|milliseconds]] or [[microsecond|microseconds]] since an [[Epoch (reference date)#Computing|epoch]] (typically either [[January 1]], [[1970]] or [[January 1]], [[2000]]) in a signed-64 bit integer, providing a minimum of 300,000 years range.<ref>{{cite web
A variety of alternative proposals have been made, some of which are in use, including storing either [[millisecond]]s or [[microsecond]]s since an [[Epoch (reference date)#Computing|epoch]] (typically either [[January 1]], [[1970]] or [[January 1]], [[2000]]) in a signed-64 bit integer, providing a minimum of 300,000 years range.<ref>{{cite web
|url=http://unununium.org/articles/uuutime
|url=http://unununium.org/articles/uuutime
|archiveurl=http://web.archive.org/web/20060408161959/http://unununium.org/articles/uuutime
|archiveurl=http://web.archive.org/web/20060408161959/http://unununium.org/articles/uuutime

Revision as of 02:40, 20 July 2008

Example showing how the date would reset (at 03:14:08 UTC on 19 January 2038).

The year 2038 problem (also known as "Unix Millennium bug", "Y2K38," "Y2K+38," or "Y2.038K" by analogy to the Y2K problem) may cause some computer software to fail before or in the year 2038. The problem affects Unix-like dating systems, which represent system time as the number of seconds (ignoring leap seconds) since 00:00:00 January 1, 1970.[1] This representation also affects software written for most other operating systems because of the broad deployment of C. On most 32-bit systems, the time t data type used to store this second count is a signed 32-bit integer. The latest time that can be represented in this format, following the POSIX standard, is 03:14:07 UTC on Tuesday, January 19, 2038. Times beyond this moment will "wrap around" and be represented internally as a negative number, and cause programs to fail, since they will see these times as being not in 2038, but rather in 1901. Erroneous calculations and decisions may therefore result.

Known problems

In May 2006, reports surfaced of an early Y2038 problem in the AOLserver software. The software would specify that a database request should "never" time out by specifying a timeout date one billion seconds in the future. One billion seconds (just over 31 years 251 days and 12 hours) after 21:27:28 on 12 May 2006 is beyond the 2038 cutoff date, so after this date, the timeout calculation overflowed and calculated a timeout date that was actually in the past, causing the software to crash.[2][3]

Example

$ date
Su 6. Jul 00:32:27 CEST 2008
$ openssl req -x509 -in server.csr -key server.key -out server.crt -days 10789 && openssl x509 -in server.crt -text | grep After
            Not After : Jan 18 22:32:32 2038 GMT
$ openssl req -x509 -in server.csr -key server.key -out server.crt -days 10790 && openssl x509 -in server.crt -text | grep After
            Not After : Dec 14 16:04:21 1901 GMT   (32-Bit System)
$ openssl req -x509 -in server.csr -key server.key -out server.crt -days 2918831 && openssl x509 -in server.crt -text | grep After
            Not After : Dec 31 22:41:18 9999 GMT   (64-Bit System)

Solutions

There is no easy fix for this problem for existing CPU/OS/File System combinations. Changing the definition of time_t to use a 64-bit type would break binary compatibility for software, data storage, and generally anything dealing with the binary representation of time. Changing time_t to an unsigned 32-bit integer, effectively allowing timestamps to be accurate until the year 2106, would affect many programs that deal with time differences, and thus also break binary compatibility in many cases.

Most operating systems for 64-bit architectures already use 64-bit integers in their time_t. The move to these architectures is already under way and many expect it to be complete before 2038. Using a (signed) 64-bit value introduces a new wraparound date in about 290 billion years, on Sunday, December 4, 292,277,026,596. This problem, however, is not widely regarded as a pressing issue.[citation needed] As of 2007, however, hundreds of millions of 32-bit systems are deployed, many in embedded systems, and it is far from certain they will all be replaced by 2038.

Despite the modern 18- to 24-month generational update in computer systems technology, embedded computers may operate unchanged for the life of the system they control. The use of 32-bit time_t has also been encoded into some file formats, which means it can live on for a long time beyond the life of the machines involved.

A variety of alternative proposals have been made, some of which are in use, including storing either milliseconds or microseconds since an epoch (typically either January 1, 1970 or January 1, 2000) in a signed-64 bit integer, providing a minimum of 300,000 years range.[4][5] 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.

See also

References

  1. ^ "The Open Group Base Specifications Issue 6 IEEE Std 1003.1, 2004 Edition (definition of epoch)". IEEE and The Open Group. The Open Group. 2004. Retrieved 2008-03-07. {{cite web}}: Cite has empty unknown parameter: |coauthors= (help)
  2. ^ "The Future Lies Ahead". 2006-06-28. Retrieved 2006-11-19. {{cite web}}: Check date values in: |date= (help)
  3. ^ Shiobara, Dossy (2006-05-17). "Something wrong after 2006-05-12 21:25". Retrieved 2006-11-19. {{cite web}}: Check date values in: |date= (help)
  4. ^ "Unununium Time". Archived from the original on 2006-08-04. Retrieved 2006-11-19. {{cite web}}: |archive-date= / |archive-url= timestamp mismatch; 2006-04-08 suggested (help)
  5. ^ Sun Microsystems. "Java API documentation: System.currentTimeMillis". {{cite web}}: Text "accessdate-2007-05-07" ignored (help)