Uses of Class
java.time.Clock
Packages that useClock
Package
Description
The main API for dates, times, instants, and durations.
Generic API for calendar systems other than the default ISO.
Uses ofClock injava.time
Modifier and TypeMethodDescriptionstaticClockObtains a clock that always returns the same instant.staticClockObtains a clock that returns instants from the specified clock with the specified duration added.staticClockObtains a clock that returns the current instant using the best available system clock.staticClockClock.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.staticClockClock.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.staticClockObtains a clock that returns instants from the specified clock truncated to the nearest occurrence of the specified duration.staticClockClock.tickMillis(ZoneId zone) Obtains a clock that returns the current instant ticking in whole milliseconds using the best available system clock.staticClockClock.tickMinutes(ZoneId zone) Obtains a clock that returns the current instant ticking in whole minutes using the best available system clock.staticClockClock.tickSeconds(ZoneId zone) Obtains a clock that returns the current instant ticking in whole seconds using the best available system clock.abstractClockReturns a copy of this clock with a different time-zone.defaultClockReturns a clock with the specified time-zone.Modifier and TypeMethodDescriptionstaticInstantObtains the current instant from the specified clock.staticLocalDateObtains the current date from the specified clock.staticLocalDateTimeObtains the current date-time from the specified clock.staticLocalTimeObtains the current time from the specified clock.staticMonthDayObtains the current month-day from the specified clock.staticOffsetDateTimeObtains the current date-time from the specified clock.staticOffsetTimeObtains the current time from the specified clock.staticYearObtains the current year from the specified clock.staticYearMonthObtains the current year-month from the specified clock.staticZonedDateTimeObtains the current date-time from the specified clock.staticClockObtains a clock that returns instants from the specified clock with the specified duration added.staticClockObtains a clock that returns instants from the specified clock truncated to the nearest occurrence of the specified duration.Uses ofClock injava.time.chrono
Methods injava.time.chrono with parameters of typeClockModifier and TypeMethodDescriptiondefaultChronoLocalDateObtains the current local date in this chronology from the specified clock.Obtains the current ISO local date from the specified clock.staticHijrahDateObtains the currentHijrahDateof the Islamic Umm Al-Qura calendar from the specified clock.staticJapaneseDateObtains the currentJapaneseDatefrom the specified clock.staticMinguoDateObtains the currentMinguoDatefrom the specified clock.staticThaiBuddhistDateObtains the currentThaiBuddhistDatefrom the specified clock.