org.threeten.bp

Instant

object Instant extends Serializable

Annotations
@SerialVersionUID( 665713676816604388L )
Linear Supertypes
Serializable, Serializable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Instant
  2. Serializable
  3. Serializable
  4. AnyRef
  5. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. val EPOCH: Instant

    Constant for the 1970-01-01T00:00:00Z epoch instant.

  7. val MAX: Instant

    The maximum supported Instant, '1000000000-12-31T23:59:59.

    The maximum supported Instant, '1000000000-12-31T23:59:59.999999999Z'. This could be used by an application as a "far future" instant.

    This is one year later than the maximum LocalDateTime. This provides sufficient values to handle the range of ZoneOffset which affect the instant in addition to the local date-time. The value is also chosen such that the value of the year fits in an int.

  8. val MIN: Instant

    The minimum supported Instant, '-1000000000-01-01T00:00Z'.

    The minimum supported Instant, '-1000000000-01-01T00:00Z'. This could be used by an application as a "far past" instant.

    This is one year earlier than the minimum LocalDateTime. This provides sufficient values to handle the range of ZoneOffset which affect the instant in addition to the local date-time. The value is also chosen such that the value of the year fits in an int.

  9. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  10. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  11. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  12. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  13. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  14. def from(temporal: TemporalAccessor): Instant

    Obtains an instance of Instant from a temporal object.

    Obtains an instance of Instant from a temporal object.

    A TemporalAccessor represents some form of date and time information. This factory converts the arbitrary temporal object to an instance of Instant.

    The conversion extracts the ChronoField#INSTANT_SECONDS INSTANT_SECONDS and ChronoField#NANO_OF_SECOND NANO_OF_SECOND fields.

    This method matches the signature of the functional interface TemporalQuery allowing it to be used as a query via method reference, Instant::from.

    temporal

    the temporal object to convert, not null

    returns

    the instant, not null

    Exceptions thrown
    DateTimeException

    if unable to convert to an { @code Instant}

  15. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  16. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  17. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  18. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  19. final def notify(): Unit

    Definition Classes
    AnyRef
  20. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  21. def now(clock: Clock): Instant

    Obtains the current instant from the specified clock.

    Obtains the current instant from the specified clock.

    This will query the specified clock to obtain the current time.

    Using this method allows the use of an alternate clock for testing. The alternate clock may be introduced using Clock dependency injection.

    clock

    the clock to use, not null

    returns

    the current instant, not null

  22. def now: Instant

    Obtains the current instant from the system clock.

    Obtains the current instant from the system clock.

    This will query the Clock#systemUTC() system UTC clock to obtain the current instant.

    Using this method will prevent the ability to use an alternate time-source for testing because the clock is effectively hard-coded.

    returns

    the current instant using the system clock, not null

  23. def ofEpochMilli(epochMilli: Long): Instant

    Obtains an instance of Instant using milliseconds from the epoch of 1970-01-01T00:00:00Z.

    Obtains an instance of Instant using milliseconds from the epoch of 1970-01-01T00:00:00Z.

    The seconds and nanoseconds are extracted from the specified milliseconds.

    epochMilli

    the number of milliseconds from 1970-01-01T00:00:00Z

    returns

    an instant, not null

    Exceptions thrown
    DateTimeException

    if the instant exceeds the maximum or minimum instant

  24. def ofEpochSecond(epochSecond: Long, nanoAdjustment: Long): Instant

    Obtains an instance of Instant using seconds from the epoch of 1970-01-01T00:00:00Z and nanosecond fraction of second.

    Obtains an instance of Instant using seconds from the epoch of 1970-01-01T00:00:00Z and nanosecond fraction of second.

    This method allows an arbitrary number of nanoseconds to be passed in. The factory will alter the values of the second and nanosecond in order to ensure that the stored nanosecond is in the range 0 to 999,999,999. For example, the following will result in the exactly the same instant:

    Instant.ofSeconds(3, 1);
    Instant.ofSeconds(4, -999_999_999);
    Instant.ofSeconds(2, 1000_000_001);
    

    epochSecond

    the number of seconds from 1970-01-01T00:00:00Z

    nanoAdjustment

    the nanosecond adjustment to the number of seconds, positive or negative

    returns

    an instant, not null

    Exceptions thrown
    ArithmeticException

    if numeric overflow occurs

    DateTimeException

    if the instant exceeds the maximum or minimum instant

  25. def ofEpochSecond(epochSecond: Long): Instant

    Obtains an instance of Instant using seconds from the epoch of 1970-01-01T00:00:00Z.

    Obtains an instance of Instant using seconds from the epoch of 1970-01-01T00:00:00Z.

    The nanosecond field is set to zero.

    epochSecond

    the number of seconds from 1970-01-01T00:00:00Z

    returns

    an instant, not null

    Exceptions thrown
    DateTimeException

    if the instant exceeds the maximum or minimum instant

  26. def parse(text: CharSequence): Instant

    Obtains an instance of Instant from a text string such as 2007-12-03T10:15:30.000Z.

    Obtains an instance of Instant from a text string such as 2007-12-03T10:15:30.000Z.

    The string must represent a valid instant in UTC and is parsed using DateTimeFormatter#ISO_INSTANT.

    text

    the text to parse, not null

    returns

    the parsed instant, not null

    Exceptions thrown
    DateTimeParseException

    if the text cannot be parsed

  27. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  28. def toString(): String

    Definition Classes
    AnyRef → Any
  29. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  30. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  31. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped