[LEAPSECS] comp.risks post in need of response

John Cowan cowan at ccil.org
Tue Dec 9 17:22:37 EST 2008

Rob Seaman scripsit:

> I'm sure someone from any of our various philosophical encampments

> would do a fine job of telling them why "NominalDiffTime" is a silly

> idea. If only the claim were true, however:


> "If you don't care about leap seconds, use UTCTime and

> NominalDiffTime for your clock calculations, and you'll be fine."

The library does not at all do what you think it does. It provides two
parallel representations of time. The first, UniversalTime, is intended
to represent UT-style timescales, and is implemented using a fractional
MJD date with arbitrary precision. (N.B.: I do not say, with arbitrary
accuracy: in practice, the implementation is hardly likely to be able
to learn the current time in UT1 with accuracy better than 0.9s,
the maximum value of DUT. Consequently, you'd need a supplementary
source of DUT to get UT1 more accurately than that.) Corresponding to
UniversalTime as a moment of time, there is DiffTime as a duration of
time, represented with a precision of 1 ps.

The second is intended to represent UTC, and is implemented using a
integral MJD date and a DiffTime representing between 0 and 86401 seconds
inclusive, with a fixed precision of 1 ps. (Providing both 0 and 86401
is presumably to allow the representation of both 00h00 and 24h00.)
Corresponding to this representation of UTC moments is NominalDiffTime,
a representation of UTC durations ignoring leap seconds: this also
has a fixed precision of 1 ps. If you had a list of leap seconds,
you could calculate the accurate DiffTime between two UTCTimes as well
as two UniversalTimes, but the underlying system does not, in general,
have such a list, so the library doesn't provide this function.

> Certainly nobody who does need to recover accurate UT1 from civil time

> is going to trust this library.

But if you have accurate UT1, you can use the library to represent it.

What has four pairs of pants, lives John Cowan
in Philadelphia, and it never rains http://www.ccil.org/~cowan
but it pours? cowan at ccil.org
--Rufus T. Firefly

More information about the LEAPSECS mailing list