sameTimeOn method
Same calendar date as the receiver with time components from other.
Returns a new DateTime with this date and other's time.
Audited: 2026-06-12 11:26 EDT
Implementation
@useResult
// ignore: saropa_lints/avoid_datetime_constructor -- date fields from this valid DateTime (implicit this); time fields from the valid DateTime other
DateTime sameTimeOn(DateTime other) => DateTime(
year,
month,
day,
other.hour,
other.minute,
other.second,
other.millisecond,
other.microsecond,
);