You are here: Re: Unix Time and Leap Seconds « PHP Programming Language « IT news, forums, messages
Re: Unix Time and Leap Seconds

Posted by Jerry Stuckle on 06/24/07 12:26

Robert Newson wrote:
> Jerry Stuckle wrote:
>
> ...
>> And while I agree with the astronomers that there is no reason for a
>> negative leap-second, programmers need to be aware it can happen!
>
> Shirley the correction for a negative leap-seacond would be to put the
> clock /forward/ 1 second? ie /increase/ the time?[1]
>

Don't call me Shirley! :-)

In the case of a leap second, yes. But you took my statement out of
context. Leap seconds are not the only reason computer clocks may need
adjustment, and sometimes that adjustment may be backwards.

> The only thing is: does the time() clock actually adjust for leap
> seconds? Leap days (and DLS) are "fixed" in the conversion to localtime;
> would leap seconds be "fixed" at the same time?
>

I don't know, but I would hope so. The problem is that leap seconds are
not fixed. They are added when necessary.

> [1] Consider that what leap days do is cause the day to be fast if you
> don't correct; the "correction" causes 1 Mar becomes 29 Feb, 2 Mar
> becomes 1 Mar, etc - the "correction" is to take the clock /backward/ by
> 86,400[2] seconds by inserting an extra 86,400 seconds. Similarly
> leap-seconds: they insert a second to take the clock backwards: the
> [physical] day is 86,401[2] seconds long (24:00:01); a negative
> leap-second would require the day to be 86,399[2] seconds long
> (23:59:59) - the only way this could shirley occur is if the earth's
> rotation /speeded up/...or the timekeepers (atomic clocks?) slowed down[3]?
> [2] Rounded to the nearest second.
> [3] Or an error was made in adding a leap second in the first place?
>
> Or have I totally misunderstood what leap seconds (and days) do?
>

In the case of leap seconds. But read the rest of my message.

Also, leap seconds are added because the earth's rotation is slowing
down due to the drag from the moon's gravity. But there is nothing to
say it couldn't speed up. Of course to do that would probably require
something like a glancing blow from a large asteroid - in which case I
doubt we would be worrying about a few seconds on a computer clock :-)

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация