core / io.islandtime / Date / copy

copy

(iosArm64, iosX64, jvm, macosX64) 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

Return a copy of this Date, replacing individual components with new values as desired.

Exceptions

DateTimeException - if the resulting date is invalid