Uses of Class
java.time.Clock

  • Packages that use Clock 
    PackageDescription
    java.time
    The main API for dates, times, instants, and durations.
    java.time.chrono
    Generic API for calendar systems other than the default ISO.
    • Uses of Clock in java.time

      Methods in java.time that return Clock 
      Modifier and TypeMethodDescription
      static ClockClock.fixed​(Instant fixedInstant, ZoneId zone)
      Obtains a clock that always returns the same instant.
      static ClockClock.offset​(Clock baseClock, Duration offsetDuration)
      Obtains a clock that returns instants from the specified clock with the specified duration added
      static ClockClock.system​(ZoneId zone)
      Obtains 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 ClockClock.tick​(Clock baseClock, Duration tickDuration)
      Obtains 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 ClockClock.withZone​(ZoneId zone)
      Returns a copy of this clock with a different time-zone.
      Methods in java.time with parameters of type Clock 
      Modifier and TypeMethodDescription
      static InstantInstant.now​(Clock clock)
      Obtains the current instant from the specified clock.
      static LocalDateLocalDate.now​(Clock clock)
      Obtains the current date from the specified clock.
      static LocalDateTimeLocalDateTime.now​(Clock clock)
      Obtains the current date-time from the specified clock.
      static LocalTimeLocalTime.now​(Clock clock)
      Obtains the current time from the specified clock.
      static MonthDayMonthDay.now​(Clock clock)
      Obtains the current month-day from the specified clock.
      static OffsetDateTimeOffsetDateTime.now​(Clock clock)
      Obtains the current date-time from the specified clock.
      static OffsetTimeOffsetTime.now​(Clock clock)
      Obtains the current time from the specified clock.
      static YearYear.now​(Clock clock)
      Obtains the current year from the specified clock.
      static YearMonthYearMonth.now​(Clock clock)
      Obtains the current year-month from the specified clock.
      static ZonedDateTimeZonedDateTime.now​(Clock clock)
      Obtains the current date-time from the specified clock.
      static ClockClock.offset​(Clock baseClock, Duration offsetDuration)
      Obtains a clock that returns instants from the specified clock with the specified duration added
      static ClockClock.tick​(Clock baseClock, Duration tickDuration)
      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

      Methods in java.time.chrono with parameters of type Clock 
      Modifier and TypeMethodDescription
      default ChronoLocalDateChronology.dateNow​(Clock clock)
      Obtains the current local date in this chronology from the specified clock.
      LocalDateIsoChronology.dateNow​(Clock clock)
      Obtains the current ISO local date from the specified clock.
      static HijrahDateHijrahDate.now​(Clock clock)
      Obtains the current HijrahDate of the Islamic Umm Al-Qura calendar from the specified clock.
      static JapaneseDateJapaneseDate.now​(Clock clock)
      Obtains the current JapaneseDate from the specified clock.
      static MinguoDateMinguoDate.now​(Clock clock)
      Obtains the current MinguoDate from the specified clock.
      static ThaiBuddhistDateThaiBuddhistDate.now​(Clock clock)
      Obtains the current ThaiBuddhistDate from the specified clock.

微信小程序

微信扫一扫体验

微信公众账号

微信扫一扫加关注

发表
评论
返回
顶部