Uses of Class
java.time.Clock
Packages that use 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 ClockObtains a clock that always returns the same instant.static ClockObtains a clock that returns instants from the specified clock with the specified duration added.static ClockObtains a clock that returns the current instant using the best available system clock.static ClockClock.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 ClockClock.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 ClockObtains a clock that returns instants from the specified clock truncated to the nearest occurrence of the specified duration.static ClockClock.tickMillis(ZoneId zone) Obtains a clock that returns the current instant ticking in whole milliseconds using the best available system clock.static ClockClock.tickMinutes(ZoneId zone) Obtains a clock that returns the current instant ticking in whole minutes using the best available system clock.static ClockClock.tickSeconds(ZoneId zone) Obtains a clock that returns the current instant ticking in whole seconds using the best available system clock.abstract ClockReturns a copy of this clock with a different time-zone.default ClockReturns a clock with the specified time-zone.Modifier and TypeMethodDescriptionstatic InstantObtains the current instant from the specified clock.static LocalDateObtains the current date from the specified clock.static LocalDateTimeObtains the current date-time from the specified clock.static LocalTimeObtains the current time from the specified clock.static MonthDayObtains the current month-day from the specified clock.static OffsetDateTimeObtains the current date-time from the specified clock.static OffsetTimeObtains the current time from the specified clock.static YearObtains the current year from the specified clock.static YearMonthObtains the current year-month from the specified clock.static ZonedDateTimeObtains the current date-time from the specified clock.static ClockObtains a clock that returns instants from the specified clock with the specified duration added.static ClockObtains 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
Methods in java.time.chrono with parameters of type ClockModifier and TypeMethodDescriptiondefault ChronoLocalDateObtains the current local date in this chronology from the specified clock.Obtains the current ISO local date from the specified clock.static HijrahDateObtains the currentHijrahDateof the Islamic Umm Al-Qura calendar from the specified clock.static JapaneseDateObtains the currentJapaneseDatefrom the specified clock.static MinguoDateObtains the currentMinguoDatefrom the specified clock.static ThaiBuddhistDateObtains the currentThaiBuddhistDatefrom the specified clock.