Uses of Class
java.time.Clock
Package
Description
The main API for dates, times, instants, and durations.
Generic API for calendar systems other than the default ISO.
-
Uses of Clock in java.time
Modifier and TypeMethodDescriptionstatic Clock
Obtains a clock that always returns the same instant.static Clock
Obtains a clock that returns instants from the specified clock with the specified duration added.static Clock
Obtains a clock that returns the current instant using the best available system clock.static Clock
Clock.systemDefaultZone()
Obtains a clock that returns the current instant using the best available system clock, converting to date and time using the default time-zone.static Clock
Clock.systemUTC()
Obtains a clock that returns the current instant using the best available system clock, converting to date and time using the UTC time-zone.static Clock
Obtains a clock that returns instants from the specified clock truncated to the nearest occurrence of the specified duration.static Clock
Clock.tickMillis
(ZoneId zone) Obtains a clock that returns the current instant ticking in whole milliseconds using the best available system clock.static Clock
Clock.tickMinutes
(ZoneId zone) Obtains a clock that returns the current instant ticking in whole minutes using the best available system clock.static Clock
Clock.tickSeconds
(ZoneId zone) Obtains a clock that returns the current instant ticking in whole seconds using the best available system clock.abstract Clock
Returns a copy of this clock with a different time-zone.default Clock
Returns a clock with the specified time-zone.Modifier and TypeMethodDescriptionstatic Instant
Obtains the current instant from the specified clock.static LocalDate
Obtains the current date from the specified clock.static LocalDateTime
Obtains the current date-time from the specified clock.static LocalTime
Obtains the current time from the specified clock.static MonthDay
Obtains the current month-day from the specified clock.static OffsetDateTime
Obtains the current date-time from the specified clock.static OffsetTime
Obtains the current time from the specified clock.static Year
Obtains the current year from the specified clock.static YearMonth
Obtains the current year-month from the specified clock.static ZonedDateTime
Obtains the current date-time from the specified clock.static Clock
Obtains a clock that returns instants from the specified clock with the specified duration added.static Clock
Obtains a clock that returns instants from the specified clock truncated to the nearest occurrence of the specified duration. -
Uses of Clock in java.time.chrono
Modifier and TypeMethodDescriptiondefault ChronoLocalDate
Obtains the current local date in this chronology from the specified clock.Obtains the current ISO local date from the specified clock.static HijrahDate
Obtains the currentHijrahDate
of the Islamic Umm Al-Qura calendar from the specified clock.static JapaneseDate
Obtains the currentJapaneseDate
from the specified clock.static MinguoDate
Obtains the currentMinguoDate
from the specified clock.static ThaiBuddhistDate
Obtains the currentThaiBuddhistDate
from the specified clock.