[LEAPSECS] Java JSR-310 Instant class: suggested changes

Stephen Colebourne scolebourne at joda.org
Sat Jan 29 17:31:58 EST 2011


On 29 January 2011 15:06, Gerard Ashton <ashtongj at comcast.net> wrote:

> I suggest the following replacement for parts of the the Instant

> description. I offer the replacement because the wording of

> UTC-SLS clearly only applies after 1 January 1972, and that

> scale should be regarded as undefined prior to that date.


Thanks for the thoughts. I can see where you are driving at, but since
UT/UT1/UT2 are not well-defined in the far past AFAIK, then the
definition below isn;t ideal either. I agree that something needs to
change though.

Stephen



>

> This is the Javadoc for Instant, the most widely used class. It has

> 86400 "seconds" per day as most users want and expect....

>

> * <h4>Time-scale</h4> * <p> * {@code Instant} uses, beginning

> 1972-01-01T00:00 UTC, the

> <a href="http://www.cl.cam.ac.uk/~mgk25/time/utc-sls/">UTC-SLS</a>

> time-scale which always has 86 400 seconds in a day.

>

> *Prior to 1972-01-01T00:00 UTC the time scale is universal time (UT),

> each day of which shall consist of 86 400 seconds, and the precise variant

> of

> UT (such as UT1 or UT2) shall be application defined.

>

> *At the transition between the UT time scale and the UTC-SLS time scale

> there was a step. If UT is interpreted as UT1 then in reality at

> 1972-01-01T00:00 UTC

> UTC-SLS = UTC; UTC - UT1 = 0.043 s.

>

> *Due to the undesirability of steps, for purposes of this class

> the approximation

> 1972-01-01T00:00 UT = 1972-01-01T00:00 UTC

> is adopted and applications which cannot tolerate this

> approximation shall not use this class.

>

> * Essentially, UTC-SLS is a consistent mechanism of converting an

> accurate UTC time....

>

> * The UTC-SLS time-scale and UT time-scale are also used for all

> human-scale date-time classes, such as {@code OffsetDateTime}

>

> and {@code ZonedDateTime}.

>

> * The standard Java epoch of 1970 is

> prior to the introduction of whole leap seconds into UTC in 1972.

> *As such, the Time Framework for Java needs to define what the 1970

>> epoch actually means.

> * The chosen definition is that the value of Instant for

> 1972-01-01T00:00 UTC is 63 072 000 seconds.

>

> * Operations to add or subtract durations

> will result in the number of nominal seconds which passed

> using the UT or UTC-SLS time scale(s) in effect at the time

> the duration took place, which will not necessarily be

> SI seconds.

>

> * Use {@code UTCInstant} or {@code

> TAIInstant} if accurate duration calculations are required.

>

> Gerry Ashton

>

> _______________________________________________

> LEAPSECS mailing list

> LEAPSECS at leapsecond.com

> http://six.pairlist.net/mailman/listinfo/leapsecs

>

>



More information about the LEAPSECS mailing list