Skip to content

//core/io.islandtime/DateTime/copy

copy

common

fun copy(date: Date = this.date, time: Time = this.time): DateTime

fun copy(year: Int = this.year, dayOfYear: Int, hour: Int = this.hour, minute: Int = this.minute, second: Int = this.second, nanosecond: Int = this.nanosecond): DateTime

fun copy(year: Int = this.year, month: Month = this.month, dayOfMonth: Int = this.dayOfMonth, hour: Int = this.hour, minute: Int = this.minute, second: Int = this.second, nanosecond: Int = this.nanosecond): DateTime

fun copy(year: Int = this.year, monthNumber: Int, dayOfMonth: Int = this.dayOfMonth, hour: Int = this.hour, minute: Int = this.minute, second: Int = this.second, nanosecond: Int = this.nanosecond): DateTime

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

Throws

DateTimeException if the resulting date-time is invalid