sealed class Time extends TimeLike[Time] with Serializable
An absolute point in time, represented as the number of nanoseconds since the Unix epoch.
- See also
Duration for intervals between two points in time.
Stopwatch for measuring elapsed time.
TimeFormatter for converting to and from
String
representations.
- Alphabetic
- By Inheritance
- Time
- Serializable
- TimeLike
- Ordered
- Comparable
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- def +(delta: Duration): Time
Adds
delta
to thisTimeLike
.Adds
delta
to thisTimeLike
. AddingDuration.Top
results in theTimeLike
'sTop
, addingDuration.Bottom
results in theTimeLike
'sBottom
.- Definition Classes
- TimeLike
- def -(that: Time): Duration
Creates a duration between two times.
- def -(delta: Duration): Time
- Definition Classes
- TimeLike
- def <(that: Time): Boolean
- Definition Classes
- Ordered
- def <=(that: Time): Boolean
- Definition Classes
- Ordered
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def >(that: Time): Boolean
- Definition Classes
- Ordered
- def >=(that: Time): Boolean
- Definition Classes
- Ordered
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def ceil(increment: Duration): Time
Rounds up to the nearest multiple of the given duration.
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def compare(that: Time): Int
- Definition Classes
- TimeLike → Ordered
- def compareTo(that: Time): Int
- Definition Classes
- Ordered → Comparable
- def diff(that: Time): Duration
The difference between the two
TimeLike
s - final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(other: Any): Boolean
- Definition Classes
- Time → AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- def floor(increment: Duration): Time
Rounds down to the nearest multiple of the given duration.
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- Time → AnyRef → Any
- def inDays: Int
- Definition Classes
- TimeLike
- def inHours: Int
- Definition Classes
- TimeLike
- def inLongSeconds: Long
- Definition Classes
- TimeLike
- def inMicroseconds: Long
- Definition Classes
- TimeLike
- def inMillis: Long
- Definition Classes
- TimeLike
- def inMilliseconds: Long
- Definition Classes
- TimeLike
- def inMinutes: Int
- Definition Classes
- TimeLike
- def inNanoseconds: Long
The
TimeLike
's value in nanoseconds. - def inSeconds: Int
- Definition Classes
- TimeLike
- def inTimeUnit: (Long, TimeUnit)
Returns a value/
TimeUnit
pair; attempting to return coarser grained values if possible (specifically:TimeUnit.MINUTES
,TimeUnit.SECONDS
orTimeUnit.MILLISECONDS
) before resorting to the defaultTimeUnit.NANOSECONDS
.Returns a value/
TimeUnit
pair; attempting to return coarser grained values if possible (specifically:TimeUnit.MINUTES
,TimeUnit.SECONDS
orTimeUnit.MILLISECONDS
) before resorting to the defaultTimeUnit.NANOSECONDS
.- Definition Classes
- TimeLike
- def isFinite: Boolean
Is this a finite TimeLike value?
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def isZero: Boolean
Is this a finite TimeLike value and equals 0
Is this a finite TimeLike value and equals 0
- Definition Classes
- TimeLike
- def max(that: Time): Time
- Definition Classes
- TimeLike
- def min(that: Time): Time
- Definition Classes
- TimeLike
- def minus(that: Time): Duration
Finds a diff between this and that time.
- def minus(delta: Duration): Time
Subtracts
delta
from thisTime
. - def moreOrLessEquals(other: Time, maxDelta: Duration): Boolean
Equality within
maxDelta
Equality within
maxDelta
- Definition Classes
- TimeLike
- val nanos: Long
- Attributes
- protected
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def ops: Time.type
- def plus(delta: Duration): Time
Adds
delta
to thisTime
. - def since(that: Time): Duration
Duration that has passed between the given time and the current time.
- def sinceEpoch: Duration
Duration that has passed between the epoch and the current time.
- def sinceNow: Duration
Gets the current time as Duration since now
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toDate: Date
Converts this Time object to a java.util.Date
- def toInstant: Instant
Converts this Time object to a java.time.Instant
- def toOffsetDateTime: OffsetDateTime
Converts this Time object to a java.time.OffsetDateTime with ZoneId of UTC
- def toString(): String
Renders this time using the default format.
Renders this time using the default format.
- Definition Classes
- Time → AnyRef → Any
- def toZonedDateTime: ZonedDateTime
Converts this Time object to a java.time.ZonedDateTime with ZoneId of UTC
- def until(that: Time): Duration
Duration between current time and the given time.
- def untilEpoch: Duration
Gets the duration between this time and the epoch.
- def untilNow: Duration
Gets the duration between this time and now.
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
Deprecated Value Members
- def format(pattern: String, locale: Locale): String
Formats this Time according to the given SimpleDateFormat pattern and locale.
Formats this Time according to the given SimpleDateFormat pattern and locale.
- Annotations
- @deprecated
- Deprecated
Use TimeFormatter instead. See TimeFormat documentation for information on pattern differences.
- def format(pattern: String): String
Formats this Time according to the given SimpleDateFormat pattern.
Formats this Time according to the given SimpleDateFormat pattern.
- Annotations
- @deprecated
- Deprecated
Use TimeFormatter instead. See TimeFormat documentation for information on pattern differences.