Uses of Class
java.time.Period

  • Packages that use Period 
    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.
    java.time.format
    Provides classes to print and parse dates and times.
    • Uses of Period in java.time

      Fields in java.time declared as Period 
      Modifier and TypeFieldDescription
      static PeriodPeriod.ZERO
      A constant for a period of zero.
      Methods in java.time that return Period 
      Modifier and TypeMethodDescription
      static PeriodPeriod.between​(LocalDate startDateInclusive, LocalDate endDateExclusive)
      Obtains a Period consisting of the number of years, months, and days between two dates.
      static PeriodPeriod.from​(TemporalAmount amount)
      Obtains an instance of Period from a temporal amount.
      PeriodPeriod.minus​(TemporalAmount amountToSubtract)
      Returns a copy of this period with the specified period subtracted.
      PeriodPeriod.minusDays​(long daysToSubtract)
      Returns a copy of this period with the specified days subtracted.
      PeriodPeriod.minusMonths​(long monthsToSubtract)
      Returns a copy of this period with the specified months subtracted.
      PeriodPeriod.minusYears​(long yearsToSubtract)
      Returns a copy of this period with the specified years subtracted.
      PeriodPeriod.multipliedBy​(int scalar)
      Returns a new instance with each element in this period multiplied by the specified scalar.
      PeriodPeriod.negated()
      Returns a new instance with each amount in this period negated.
      PeriodPeriod.normalized()
      Returns a copy of this period with the years and months normalized.
      static PeriodPeriod.of​(int years, int months, int days)
      Obtains a Period representing a number of years, months and days.
      static PeriodPeriod.ofDays​(int days)
      Obtains a Period representing a number of days.
      static PeriodPeriod.ofMonths​(int months)
      Obtains a Period representing a number of months.
      static PeriodPeriod.ofWeeks​(int weeks)
      Obtains a Period representing a number of weeks.
      static PeriodPeriod.ofYears​(int years)
      Obtains a Period representing a number of years.
      static PeriodPeriod.parse​(CharSequence text)
      Obtains a Period from a text string such as PnYnMnD.
      PeriodPeriod.plus​(TemporalAmount amountToAdd)
      Returns a copy of this period with the specified period added.
      PeriodPeriod.plusDays​(long daysToAdd)
      Returns a copy of this period with the specified days added.
      PeriodPeriod.plusMonths​(long monthsToAdd)
      Returns a copy of this period with the specified months added.
      PeriodPeriod.plusYears​(long yearsToAdd)
      Returns a copy of this period with the specified years added.
      PeriodLocalDate.until​(ChronoLocalDate endDateExclusive)
      Calculates the period between this date and another date as a Period.
      PeriodPeriod.withDays​(int days)
      Returns a copy of this period with the specified amount of days.
      PeriodPeriod.withMonths​(int months)
      Returns a copy of this period with the specified amount of months.
      PeriodPeriod.withYears​(int years)
      Returns a copy of this period with the specified amount of years.
      Methods in java.time with parameters of type Period 
      Modifier and TypeMethodDescription
      Stream<LocalDate>LocalDate.datesUntil​(LocalDate endExclusive, Period step)
      Returns a sequential ordered stream of dates by given incremental step.
    • Uses of Period in java.time.chrono

      Methods in java.time.chrono that return Period 
      Modifier and TypeMethodDescription
      PeriodIsoChronology.period​(int years, int months, int days)
      Obtains a period for this chronology based on years, months and days.
    • Uses of Period in java.time.format

      Methods in java.time.format that return types with arguments of type Period 
      Modifier and TypeMethodDescription
      static TemporalQuery<Period>DateTimeFormatter.parsedExcessDays()
      A query that provides access to the excess days that were parsed.

微信小程序

微信扫一扫体验

微信公众账号

微信扫一扫加关注

发表
评论
返回
顶部