< prev index next >

src/java.base/share/classes/java/time/Instant.java

Print this page




 176  * proleptically, which is equivalent to the (mean) solar time on the
 177  * prime meridian (Greenwich). In this segment, the Java Time-Scale is
 178  * identical to the consensus international time scale. The exact
 179  * boundary between the two segments is the instant where UT1 = UTC
 180  * between 1972-11-03T00:00 and 1972-11-04T12:00.
 181  * <p>
 182  * Implementations of the Java time-scale using the JSR-310 API are not
 183  * required to provide any clock that is sub-second accurate, or that
 184  * progresses monotonically or smoothly. Implementations are therefore
 185  * not required to actually perform the UTC-SLS slew or to otherwise be
 186  * aware of leap seconds. JSR-310 does, however, require that
 187  * implementations must document the approach they use when defining a
 188  * clock representing the current instant.
 189  * See {@link Clock} for details on the available clocks.
 190  * <p>
 191  * The Java time-scale is used for all date-time classes.
 192  * This includes {@code Instant}, {@code LocalDate}, {@code LocalTime}, {@code OffsetDateTime},
 193  * {@code ZonedDateTime} and {@code Duration}.
 194  *
 195  * <p>
 196  * This is a <a href="{@docRoot}/java/lang/doc-files/ValueBased.html">value-based</a>
 197  * class; use of identity-sensitive operations (including reference equality
 198  * ({@code ==}), identity hash code, or synchronization) on instances of
 199  * {@code Instant} may have unpredictable results and should be avoided.
 200  * The {@code equals} method should be used for comparisons.
 201  *
 202  * @implSpec
 203  * This class is immutable and thread-safe.
 204  *
 205  * @since 1.8
 206  */
 207 public final class Instant
 208         implements Temporal, TemporalAdjuster, Comparable<Instant>, Serializable {
 209 
 210     /**
 211      * Constant for the 1970-01-01T00:00:00Z epoch instant.
 212      */
 213     public static final Instant EPOCH = new Instant(0, 0);
 214     /**
 215      * The minimum supported epoch second.
 216      */




 176  * proleptically, which is equivalent to the (mean) solar time on the
 177  * prime meridian (Greenwich). In this segment, the Java Time-Scale is
 178  * identical to the consensus international time scale. The exact
 179  * boundary between the two segments is the instant where UT1 = UTC
 180  * between 1972-11-03T00:00 and 1972-11-04T12:00.
 181  * <p>
 182  * Implementations of the Java time-scale using the JSR-310 API are not
 183  * required to provide any clock that is sub-second accurate, or that
 184  * progresses monotonically or smoothly. Implementations are therefore
 185  * not required to actually perform the UTC-SLS slew or to otherwise be
 186  * aware of leap seconds. JSR-310 does, however, require that
 187  * implementations must document the approach they use when defining a
 188  * clock representing the current instant.
 189  * See {@link Clock} for details on the available clocks.
 190  * <p>
 191  * The Java time-scale is used for all date-time classes.
 192  * This includes {@code Instant}, {@code LocalDate}, {@code LocalTime}, {@code OffsetDateTime},
 193  * {@code ZonedDateTime} and {@code Duration}.
 194  *
 195  * <p>
 196  * This is a <a href="{@docRoot}/java.base/java/lang/doc-files/ValueBased.html">value-based</a>
 197  * class; use of identity-sensitive operations (including reference equality
 198  * ({@code ==}), identity hash code, or synchronization) on instances of
 199  * {@code Instant} may have unpredictable results and should be avoided.
 200  * The {@code equals} method should be used for comparisons.
 201  *
 202  * @implSpec
 203  * This class is immutable and thread-safe.
 204  *
 205  * @since 1.8
 206  */
 207 public final class Instant
 208         implements Temporal, TemporalAdjuster, Comparable<Instant>, Serializable {
 209 
 210     /**
 211      * Constant for the 1970-01-01T00:00:00Z epoch instant.
 212      */
 213     public static final Instant EPOCH = new Instant(0, 0);
 214     /**
 215      * The minimum supported epoch second.
 216      */


< prev index next >