public LocalDateTime withDayOfYear (int dayOfYear)

Returns a copy of this LocalDateTime with the day-of-year altered.

If the resulting date-time is invalid, an exception is thrown.

This instance is immutable and unaffected by this method call.

Parameters:
dayOfYear    the day-of-year to set in the result, from 1 to 365-366

Returns:  a LocalDateTime based on this date with the requested day, not null

Exceptions:
DateTimeException    if the day-of-year value is invalid, or if the day-of-year is invalid for the year