Computer Geek

Musings about technology, computer books and software.

September 08, 2005

What will you do with your extra second?

This article explains a number of concepts related to Unix time, UTC and TAI and is an interesting read.

A day works out to 86,400 seconds, but not exactly. Operating systems based on Unix (like Linux) use a counter to keep track of the exact time (which includes the day).

The time is presented to the user by dividing this counter by 86,400 and adding the days from January 1, 1970 (12:01 midnight) to give the present date; the remainder is used to give the time. This would be perfect except that the Earth is ever-slowing its rotation which means that every few years a leap second is added.
The problem this presents for UNIX time is that the addition of leap seconds occurs at irregular, somewhat arbitrary intervals, as the slowing of the Earth's rotation is not predictable over the long term. As such, programmers must manually factor leap seconds into programmatic date calculations for systems based on UNIX time, which is a complicated task. Different programmers and development standards handle the task in different ways, which can occasionally lead to minor problems when time-sensitive software communicates over extended periods.
And by the way, a leap second is added soon this year. So plan accordingly:
The next planned addition of a leap second is Dec. 31, 2005. On that date, 11:59 P.M. UTC will be 61 seconds long, and the clock will actually sequence from 23:59:59 to 23:59:60, rather than from 23:59:59 to 00:00:00.
Don't forget to reset your clocks!

0 Comments:

Post a Comment

<< Home