copyWith method
Returns a copy of this with the updated units of time.
LocalDateTime(2023, 4, 15, 12, 30).copyWith(day: 20); // 2023-04-20 12:30
Implementation
@useResult LocalDateTime copyWith({int? year, int? month, int? day, int? hour, int? minute, int? second, int? millisecond, int? microsecond}) =>
LocalDateTime(
year ?? this.year,
month ?? this.month,
day ?? this.day,
hour ?? this.hour,
minute ?? this.minute,
second ?? this.second,
millisecond ?? this.millisecond,
microsecond ?? this.microsecond,
);