copy

fun copy(year: Int = this.year, month: Month = this.month, dayOfMonth: Int = this.day): Date
fun copy(year: Int = this.year, monthNumber: Int, dayOfMonth: Int = this.day): Date
fun copy(year: Int = this.year, dayOfYear: Int = this.dayOfYear): Date

Returns a copy of this date with the values of any individual components replaced by the new values specified.

Throws

if the resulting date is invalid