LocalDateTime.withYear

Returns a copy of this {@code LocalDateTime} with the year altered. !(p) The time does not affect the calculation and will be the same _in the result. If the day-of-month is invalid for the year, it will be changed to the last valid day of the month. !(p) This instance is immutable and unaffected by this method call.

@param year the year to set _in the result, from MIN_YEAR to MAX_YEAR @return a {@code LocalDateTime} based on this date-time with the requested year, not null @throws DateTimeException if the year value is invalid

class LocalDateTime
withYear
(
int year
)

Meta