Time and time again (UTC leap seconds)

I just did a tiny NTP time read utility. NTP comes in UTC, which is in seconds since 1900 - OK, I did that. There are a number of years between 1972 and now which have been 1or 2 seconds longer - I found a table of them (in wikipedia) and did things accordingly. Only to discover that the time I reported so was 23 (or so) seconds behind the time the wintel system finds using the same server... I immediately tried things out without the additional UTC seconds (just stripped all +1 out of the source:-) and there is was - precise match.

Now what do I do? Who is correct? I'll wait another 18 minutes for the radio now to check on the hour but I am pretty sure there are people here who have done clocks using NTP and would know what I am trying to discover.

Thanks,

Dimiter

------------------------------------------------------ Dimiter Popoff Transgalactic Instruments

formatting link

------------------------------------------------------

formatting link

Reply to
Didi
Loading thread data ...

This seems to explain the phenomenon adequately. Essentially it would appear you only need to insert leap-seconds that have occurred between the last time you went upstream for time information and the present moment.

Reply to
larwe

Looks pretty much so. I located a number of UTC clocks on the net and they all agreed. Apparently the NTP time comes modified - so it is not exactly seconds since 1900, but seconds since 1900 excluding the leap seconds... Quite a mess, but since removing the table only makes it simpler, I'll just do it and move on.

Thanks,

Dimiter

------------------------------------------------------ Dimiter Popoff Transgalactic Instruments

formatting link

------------------------------------------------------

formatting link

Reply to
Didi

This is correct. It may not be elegant but if you stop and think about it you'll come to understand that doing it any other way would soon become nightmarishly complicated. It would complicate simple count->wall time conversions no end in the general case, and all machines would either need to know about leap seconds in advance (not very likely in the real world) or the protocol would need some way of disseminating information not only about upcoming leap seconds, but the total number and exact positions of all previous leaps seconds.

Added to that you have the need for arbitrary sized tables and you can see why the decision was made to fudge it slightly, particularly since many (most?) applications don't actually _need_ accurate to-the-second timing... Unix time works in a very similar way, although the behaviour _during_ leap seconds differs.

In summary, yes it is a fudge, so is the whole concept of leap seconds and, indeed, leap years. In the end it doesn't matter how you were to define things: it would still be messy.

--
Andrew Smallshaw
andrews@sdf.lonestar.org
Reply to
Andrew Smallshaw

Eventually we will be able to solve this problem by servoing the rotation and orbit of the earth to our atomic clocks. :)

--
Guy Macon
Reply to
Guy Macon

I agree it cannot be made much better than that, the planet rotation speed varying... I already made the utility being able to use also rfc868 style servers (they send unix time rather than UTC over a tcp conection rather than a UDP packet), now I'll add the ability to serve time and it will go into the archive. I guess I may have to readdress this when we manage to implement Guy Macons proposal to fix the Earth rotation period. Or may be somewhat earlier, like 2036... :-).

Dimiter

------------------------------------------------------ Dimiter Popoff Transgalactic Instruments

formatting link

------------------------------------------------------

formatting link

Reply to
Didi

I suppose we'll have so much excess capacity in our tidal power generation plants, that we can switch between equatorial and polar plants to affect the spin. :-)

Actually, given that energy lost due to viscosity in tidal flows is coming from the earth-moon orbital system, I predict a future world (far future) where the new "impending catastrophe" is geological disruption (vulcanism) because our extraction of tidal power has decayed the moon's orbit to half what it is now. Hmmm, it's even possible to calculate how many joules need to be extracted for that!

Not global warming, but global cracking :-). Or is that a crackpot theory? :-)

Clifford Heath.

Reply to
Clifford Heath

My understanding is that the power comes from slowing the Earth's rotation. The angular momentum is transferred to the Moon, which therefore rises to higher orbits. As the Moon's apparent diameter shrinks, soon there will be no more total eclipses... Save the eclipses! Help the tides flow!

--
Niklas Holsti
Tidorum Ltd
niklas holsti tidorum fi
       .      @       .
Reply to
Niklas Holsti

Niklas Holsti escribió:

If you save the _eclipses_, the other _t_raditional _ides_ will vanish and cease to flow...

Sorry...

Reply to
Ignacio G.T.

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.