[LEAPSECS] Java: ThreeTen/JSR-310

Michael Deckers michael.deckers at yahoo.com
Sat Jan 29 12:52:41 EST 2011



On 2011-01-28 18:34, Gerard Ashton asked:


> Windows and Unix have general reputations of not doing it right; does

> anyone know of a hardware/operating system combination that handles leap

> seconds correctly? If so, does it have a defined approach to providing a

> quasi-UTC that hides leap seconds to applications that wish to live in

> blissful ignorance?


No, I do not know where it is done "correctly" -- I just know some
programming languages where datetimes and time scales are modelled
in other ways than in the JSR-310 proposal. Let me just mention two.

Take ADA95, for example. The language accepts the existence of
various independent time scales, that is, physical quantities that
all take their values in the same space of datetimes. That space
provides the operations of an affine space over the one-dimensional
vector space of times, with units s, min, h, d, etc.
Datetimes values can be denoted using calendars or with affine
units such as Julian dates or Besselina epochs.

Whether values of one time scale can be converted (in whatever
sense) to values of another time scale is not imposed by the
interface. Some time scales can be converted exactly (eg, TCG to
TT), some exactly only for past epochs (eg, UTC and TAI), some
only approximately, even for the past (eg, TT to TAI).

ADA95 also recognizes the fact that it is sometimes needed
to add additional information to a datetime value: viz, the
information that the datetime value occurs twice in a non-monotone
time scale. This is needed to order such amended datetime values
in the case of leap seconds, and in the case of civil time scales
while they switch from summer time to winter time. Other additional
operations on these values comprise better conversions to other
time scales, eg, unambiguous conversion from UTC to TAI, or from
civil time to UTC with the help of a zic file.

SQL provides datetime values with an additional offset so that
they comprise both a local time scale and a UTC value. This is
another form of amended datetime values that is important in
applications. It can also model a UTC time stamp with known
offset to TAI. This amendment is independent of the previous
one, so that I would expect a complete support to provide datetime
types with both amendments, too.

I have left out all the gory details and I hope this comment is
still not too abstract.

Michael Deckers.


More information about the LEAPSECS mailing list