Object/Class

org.threeten.bp

Instant

Related Docs: class Instant | package bp

Permalink

object Instant extends Serializable

Annotations
@SerialVersionUID()
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
Visibility
  1. Public
  2. All

Value Members

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

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

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

    Permalink
    Definition Classes
    AnyRef → Any
  4. lazy val EPOCH: Instant

    Permalink

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

  5. lazy val MAX: Instant

    Permalink

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

    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.

  6. lazy val MIN: Instant

    Permalink

    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.

  7. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  8. def clone(): AnyRef

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

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

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

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

    Permalink

    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 INSTANT_SECONDS and 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}

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

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

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

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

    Permalink
    Definition Classes
    AnyRef
  17. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  18. final def notifyAll(): Unit

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

    Permalink

    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 dependency injection.

    clock

    the clock to use, not null

    returns

    the current instant, not null

  20. def now: Instant

    Permalink

    Obtains the current instant from the system clock.

    Obtains the current instant from the system clock.

    This will query the 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

  21. def ofEpochMilli(epochMilli: Long): Instant

    Permalink

    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

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

    Permalink

    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

  23. def ofEpochSecond(epochSecond: Long): Instant

    Permalink

    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

  24. def parse(text: CharSequence): Instant

    Permalink

    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

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

    Permalink
    Definition Classes
    AnyRef
  26. def toString(): String

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

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped