Uses of Class
java.time.Year

  • Packages that use Year 
    PackageDescription
    java.time
    The main API for dates, times, instants, and durations.
    • Uses of Year in java.time

      Methods in java.time that return Year 
      Modifier and TypeMethodDescription
      static YearYear.from​(TemporalAccessor temporal)
      Obtains an instance of Year from a temporal object.
      YearYear.minus​(long amountToSubtract, TemporalUnit unit)
      Returns a copy of this year with the specified amount subtracted.
      YearYear.minus​(TemporalAmount amountToSubtract)
      Returns a copy of this year with the specified amount subtracted.
      YearYear.minusYears​(long yearsToSubtract)
      Returns a copy of this Year with the specified number of years subtracted.
      static YearYear.now()
      Obtains the current year from the system clock in the default time-zone.
      static YearYear.now​(Clock clock)
      Obtains the current year from the specified clock.
      static YearYear.now​(ZoneId zone)
      Obtains the current year from the system clock in the specified time-zone.
      static YearYear.of​(int isoYear)
      Obtains an instance of Year.
      static YearYear.parse​(CharSequence text)
      Obtains an instance of Year from a text string such as 2007.
      static YearYear.parse​(CharSequence text, DateTimeFormatter formatter)
      Obtains an instance of Year from a text string using a specific formatter.
      YearYear.plus​(long amountToAdd, TemporalUnit unit)
      Returns a copy of this year with the specified amount added.
      YearYear.plus​(TemporalAmount amountToAdd)
      Returns a copy of this year with the specified amount added.
      YearYear.plusYears​(long yearsToAdd)
      Returns a copy of this Year with the specified number of years added.
      YearYear.with​(TemporalAdjuster adjuster)
      Returns an adjusted copy of this year.
      YearYear.with​(TemporalField field, long newValue)
      Returns a copy of this year with the specified field set to a new value.
      Methods in java.time with parameters of type Year 
      Modifier and TypeMethodDescription
      intYear.compareTo​(Year other)
      Compares this year to another year.
      booleanYear.isAfter​(Year other)
      Checks if this year is after the specified year.
      booleanYear.isBefore​(Year other)
      Checks if this year is before the specified year.

微信小程序

微信扫一扫体验

微信公众账号

微信扫一扫加关注

发表
评论
返回
顶部