Friday, 05-Dec-2008 07:27:23 GMT Tell a friendLink to this pageRandom Article
 
 
Online encyclopedia

 


Unix epoch

The Unix epoch is the representation of points in time as the number of seconds since 00:00:00 UTC on January 1, 1970, introduced by the Unix operating system, standardised in POSIX, and later adopted by the Java programming language. One thousand million seconds after that initial instant was 01:46:40 UTC on September 9, 2001, a moment known as the Unix billennium. The Unix epoch ends GMT 03:14:07, Tuesday, January 19, 2038.

In POSIX conforming systems, the type time-t is often used to represent times. It is an arithmetic type in the C programming language. There is no requirement that time-t be a 32-bit quantity (it could be a 64-bit integer or a floating point in double format), but most systems define time-t as a signed 32-bit integer, and many application programs may assume it, or may store values in a 32-bit type. A signed 32-bit integer type can represent numbers ranging from -231 to 231 - 1, that is, -2147483648 to 2147483647.

The time() function returns a time-t value that is the number of seconds since the Epoch. In this form, time() will run out of positive integers 231 seconds after the Epoch, in the year 2038 (sometime shortly after 03:00 on January 19 depending on how many leap seconds there are between 1970 and then). Programs will need to be changed to accommodate this, not unlike the Year 2000 problem. Adapting existing programs may be as easy as re-compiling them with header files that declare time-t as a 64-bit integer, but other programs make deep assumptions as to the nature of time-t. Also, the source code to some software packages may have been lost by then, and programmers will have to reverse engineer the software to change its date behavior. In fact, some claim that the expiration of the Unix epoch timeframe may cause more damage than was predicted for the Y2K bug.

In many ways this representation of time is awkward; because of leap seconds, it is not possible in general to say how many seconds there are between the beginning of the epoch and a particular time more than a few years in the future. This is because it is not possible to predict when a leap second will be required more than a few years in advance.

POSIX time inconsistency

One version of POSIX was inconsistent in its handling of time because it defined "seconds since the epoch" as "the number of seconds between a specified time and the epoch", and also gave a formula for it (using integer divides):

 tm-sec + tm-min*60 + tm-hour*3600 + tm-yday*86400 +
    (tm-year-70)*31536000 + ((tm-year-69)/4)*86400

This formula does not take into account leap seconds which leads to an inconsistency.

 

Tell a friend about this page.
Send this page
Bookmark Unix epoch.

 

Link to this page: The easy way to educate your website visitors. Post a link to definition / meaning of " Unix epoch " on your site.
HTML code: Resulting link:

Unix epoch

 

This online educational article is provided by contributions of Wikimedia Foundation.
Licensed under the GNU free documentation license. View live article. Copyright & Disclaimer - Contact

Partners: Digital Gadgets | Logo Design | Business Articles | Online Calculators

Anti-Spam Coalition