Class Clock.SystemClock
- All Implemented Interfaces:
Serializable
- Enclosing class:
- Clock
System.currentTimeMillis().-
Nested Class Summary
Nested classes/interfaces inherited from class org.threeten.bp.Clock
Clock.FixedClock, Clock.OffsetClock, Clock.SystemClock, Clock.TickClock -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks if this clock is equal to another clock.getZone()Gets the time-zone being used to create dates and times.inthashCode()A hash code for this clock.instant()Gets the current instant of the clock.longmillis()Gets the current millisecond instant of the clock.toString()Returns a copy of this clock with a different time-zone.Methods inherited from class org.threeten.bp.Clock
fixed, offset, system, systemDefaultZone, systemUTC, tick, tickMinutes, tickSeconds
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
zone
-
-
Constructor Details
-
SystemClock
SystemClock(ZoneId zone)
-
-
Method Details
-
getZone
Description copied from class:ClockGets the time-zone being used to create dates and times.A clock will typically obtain the current instant and then convert that to a date or time using a time-zone. This method returns the time-zone used.
-
withZone
Description copied from class:ClockReturns a copy of this clock with a different time-zone.A clock will typically obtain the current instant and then convert that to a date or time using a time-zone. This method returns a clock with similar properties but using a different time-zone.
-
millis
public long millis()Description copied from class:ClockGets the current millisecond instant of the clock.This returns the millisecond-based instant, measured from 1970-01-01T00:00 UTC. This is equivalent to the definition of
System.currentTimeMillis().Most applications should avoid this method and use
Instantto represent an instant on the time-line rather than a raw millisecond value. This method is provided to allow the use of the clock in high performance use cases where the creation of an object would be unacceptable. The default implementation currently callsClock.instant(). -
instant
Description copied from class:ClockGets the current instant of the clock.This returns an instant representing the current instant as defined by the clock.
-
equals
Description copied from class:ClockChecks if this clock is equal to another clock.Clocks must compare equal based on their state and behavior.
-
hashCode
public int hashCode()Description copied from class:ClockA hash code for this clock. -
toString
-