★ wanayoo — archive 1999 http://howstuffworks.com/question75.htmNouvelle recherche | Portail wanayoo

How Stuff Works



Question of the Day

Q&A Archive

HSW keeps a complete archive of previously answered questions to help you find answers quickly. Please Click Here for a complete list of previously answered questions.

Asking Questions

If you would like to ask a question, you can click here.
Each weekday Marshall Brain answers questions submitted by the readers of How Stuff Works in the Question of the Day section of HSW. You can also view previously answered questions in the HSW Question Archive. Here is today's question!

Question

I have heard about the Year 2000 Problem, but now I am hearing about the Year 2038 problem. What is that?

Answer

The Year 2000 problem is understood by most people these days because of the large amount of media attention it is receiving (you can also learn about it in the HSW article entitled How the Year 2000 Problem Works).

Most programs written in the C Programming Language are relatively immune to the Y2K problem, but suffer instead from the Year 2038 Problem. The problem arises because most C programs use a library of routines called the standard time library (time.h). This library establishes a standard 4-byte format for the storage of time values, and also provides a number of functions for converting, displaying and calculating time values.

The standard 4-byte format assumes that the beginning of time is January 1, 1970 at 12:00:00 AM. This value is 0. Any time/date value is expressed as the number of seconds following that zero value. So the value 919642718 is 919,642,718 seconds past 12:00:00 AM on January 1, 1970, which is Sunday Feb 21, 1999 at 16:18:38 pacific time (U.S.). This is a convenient format because you can subtract any two values and you get a number of seconds that is the time difference between them. Then you can use other functions in the library to determine how many minutes/hours/days/months/years have passed between the two times.

If you have read the HSW article on How Bits and Bytes Works, you know that a signed 4-byte integer has a maximum value of 2,147,483,648, and this is where the Year 2038 Problem comes from. The maximum value of time before it rolls over to a negative (and invalid) value is 2,147,483,648, which translates into January 19, 2038. On this date any C programs that use the standard time library will start to have problems with date calculations.

This problem is somewhat easier to fix than the Y2K problem on mainframes, fortunately. Well-written programs can simply be recompiled with a new version of the library that uses, for example, 8-byte values for the storage format. This is possible because the library encapsulates the whole time activity with its own time types and functions (unlike most mainframe programs, which did not standardize their date formats or calculations). So the Year 2038 Problem should not be nearly so hard to fix as the Y2K problem has been.

Here's a helpful link: Year 2000 and Unix


How Stuff Works Power Panel
Table of Contents
A complete list of all HSW articles

About Marshall Brain
Information about the creator of HSW

Search
Search for any word or concept in HSW

Citing HSW
Information about citing HSW in articles and papers

Question of the Day
Ask questions or browse hundreds in the archive

Books
A variety of books for people interested in how stuff works

HSW Newsletter
Sign up to receive the monthly HSW newsletter

Contacting HSW
Contact HSW directly with email

What's New
Review newsletters to chart HSW's development

Awards
Check out HSW's awards and reviews!

Disclaimer
The disclaimer required by the lawyer

Author Information
Learn how you can write for HSW

HSW Fan Buttons
Link to HSW with these snazzy fan buttons!
Suggestions
Leave a suggestion in the suggestion box


BYG Publishing How Stuff Works (http://www.howstuffworks.com) is a production of
BYG Publishing, Inc.
http://www.bygpub.com - questions@bygpub.com
P.O. Box 40492 - Raleigh, NC 27629

© 1998 BYG Publishing, Inc. All rights reserved.





Click Here!