public enum TimeScale extends Enum<TimeScale>
Defines some time scales for usage both in civil life and in science.
Any conversion is usually not bijective. That means that for example an UTC-timestamp can be mapped in a unique way to UT1, GPS or TAI (provided that there are no negative leap seconds) but in reverse not. More important: Conversions often happen in millisecond-precision or worse so they are more or less like approximation procedures.
Enum Constant and Description |
---|
GPS
Is used by the GPS-navigation system and counts SI-seconds relative
to the start of GPS.
|
POSIX
Counts the seconds relative to UNIX-epoch 1970-01-01T00:00:00Z
which is two years before UTC-epoch.
|
TAI
International atomic time which is based on the SI-seconds of an
atomic clock and presents a continuous scale relative to 1972-01-01.
|
UTC
Counts the seconds relative to UTC-epoch which started at
midnight on the calendar days 1972-01-01 (1972-01-01T00:00:00Z)
inclusive all leap seconds.
|
Modifier and Type | Method and Description |
---|---|
static TimeScale |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static TimeScale[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final TimeScale POSIX
Counts the seconds relative to UNIX-epoch 1970-01-01T00:00:00Z which is two years before UTC-epoch.
Leap seconds are not counted but ignored according to POSIX-standard. Before the UTC-epoch 1972-01-01 the second is effectively defined as the 86400th part of mean solar day (UT1). After this UTC-epoch the POSIX-second is with the exception of leap second events equal to the SI-second based on atomic clocks, but in long term effectively similar to the UT1-second based on mean solar time.
POSIX is more present in computer realms than UTC although there is no precision in calculation of SI-seconds (a bug of UNIX-specification). The definition of the reference timezone on zero meridian of Greenwich is the same as in UTC.
During a leap second the transformation of POSIX-time to an UTC-timestamp is not defined. An old convention in the UNIX world tries to reset the clock by one second AFTER the leap second, so effectively mapping the leap second to the next day despite of its obvious written form as last second of current day (see also Wikipedia-page). The current description of POSIX-time explicitly states however that the relation between the current day time and the current POSIX-value is not specified and dependent on the implementation. Time4J maps the leap second to the current day as the last second. This corresponds to an UNIX-variation where a clock is reset at the begin of a leap second instead of at the end of a leap second.
public static final TimeScale UTC
Counts the seconds relative to UTC-epoch which started at midnight on the calendar days 1972-01-01 (1972-01-01T00:00:00Z) inclusive all leap seconds.
Time4J handles all UniversalTime
-timestamps before
the UTC-epoch as mean solar time (UT1). The second is therefore
defined as the 86400th part of the mean solar day before 1972.
After the UTC-epoch 1972-01-01 the second is always the
SI-second based on atomic clocks.
UniversalTime
public static final TimeScale TAI
International atomic time which is based on the SI-seconds of an atomic clock and presents a continuous scale relative to 1972-01-01.
There is no second which is interpreted respective labelled as leapsecond. Hence this scale is decoupled from civil day and only usefule in a scientific context. As consequence the astronomic day has no meaning on this scale.
Strictly spoken, the scale definition of TAI is a statistical approximation to the definition of an SI-second because the average of around 250 atomic clocks worldwide is used. But the deviations are in picoseconds or smaller which is not in the focus of this API.
Although TAI knows historical ancestors already since 1958 Time4J only supports TAI from UTC-epoch 1972-01-01. First to note the SI-second was introduced in year 1967. Second, the nowadays used TAI-scale had got its name on a conference in year 1971, third to note, the TAI-ancestors were still directly synchronized with UT2 hence had still got a vague astronomical reference.. At the calendar date 1972-01-01 the difference between TAI and UTC was defined as exactly 10 seconds (TAI = UTC + 10). This difference is fixed for all timestamps in epoch seconds because both TAI and UTC counts in pure SI-seconds. But note: If TAI and UTC are resolved to an element-oriented notation (YYYY-MM-DD HH:MM:SS) then the difference between TAI and UTC increases with every inserted leap second because of the different labelling. A TAI day does not know leap seconds. In the year 2013 this difference between a TAI day and an UTC day has increased to 35 seconds.
public static final TimeScale GPS
Is used by the GPS-navigation system and counts SI-seconds relative to the start of GPS.
GPS was introduced on 6th of January 1980. All earlier timestamps are not supported by Time4J. Between 1972 and 1980 there were 9 leap seconds therefore following relation holds leaving aside the different epoch reference: GPS + delta = UTC - 9 = TAI - 19 where delta stands for the POSIX-difference between 1972-01-01 and 1980-01-06.
TAI
public static TimeScale[] values()
for (TimeScale c : TimeScale.values()) System.out.println(c);
public static TimeScale valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullCopyright © 2014–2017. All rights reserved.