Java java.time Clock fields, constructors, methods, implement or subclass

Example usage for Java java.time Clock fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for java.time Clock.

The text is from its open source code.

Subclass

java.time.Clock has subclasses.
Click this link to see all its subclasses.

Method

booleanequals(Object obj)
Checks if this clock is equal to another clock.
Clockfixed(Instant fixedInstant, ZoneId zone)
Obtains a clock that always returns the same instant.
ZoneIdgetZone()
Gets the time-zone being used to create dates and times.
inthashCode()
A hash code for this clock.
Instantinstant()
Gets the current instant of the clock.
longmillis()
Gets the current millisecond instant of the clock.
Clockoffset(Clock baseClock, Duration offsetDuration)
Obtains a clock that returns instants from the specified clock with the specified duration added

This clock wraps another clock, returning instants that are later by the specified duration.

Clocksystem(ZoneId zone)
Obtains a clock that returns the current instant using the best available system clock.
ClocksystemDefaultZone()
Obtains a clock that returns the current instant using the best available system clock, converting to date and time using the default time-zone.
ClocksystemUTC()
Obtains a clock that returns the current instant using the best available system clock, converting to date and time using the UTC time-zone.
Clocktick(Clock baseClock, Duration tickDuration)
Obtains a clock that returns instants from the specified clock truncated to the nearest occurrence of the specified duration.
ClocktickMinutes(ZoneId zone)
Obtains a clock that returns the current instant ticking in whole minutes using the best available system clock.
ClocktickSeconds(ZoneId zone)
Obtains a clock that returns the current instant ticking in whole seconds using the best available system clock.
ClockwithZone(ZoneId zone)
Returns a copy of this clock with a different time-zone.