core / io.islandtime / Date / copy

copy

(iosArm64, iosX64, jvm, macosX64, tvosArm64, tvosX64, watchosArm64, watchosX86) 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.

Exceptions

DateTimeException - if the resulting date is invalid