Returns a copy of this LocalDateTime with the specified number of years subtracted.
This method subtracts the specified amount from the years field in three steps:
For example, 2008-02-29 (leap year) minus one year would result in the invalid date 2007-02-29 (standard year). Instead of returning an invalid result, the last valid day of the month, 2007-02-28, is selected instead.
This instance is immutable and unaffected by this method call.
years | the years to subtract, may be negative |
LocalDateTime based on this date-time with the years subtracted, not null
DateTimeException | if the result exceeds the supported date range |
Diagram: LocalDateTime