tomorrow static method
Returns the date for tomorrow at the specified time.
Pass now to override the current date (useful for testing). The
returned date has its time set to hour, minute, and second
(all defaulting to 0). "Tomorrow" is the next calendar day, including
across daylight-saving changes, and keeps the UTC/local kind of now.
Audited: 2026-06-12 11:26 EDT
Implementation
@useResult
static DateTime tomorrow({DateTime? now, int? hour, int minute = 0, int second = 0}) {
// Calculate the date for tomorrow at the specified time
final DateTime resolvedNow = now ?? DateTime.now();
// Calendar-day step: addDays adds 24 elapsed hours, which from just after
// midnight on a 25-hour day stays on the same date, returning today.
final DateTime tomorrowAtSpecifiedTime = resolvedNow.addCalendarDays(1);
return tomorrowAtSpecifiedTime.copyWith(
hour: hour ?? 0,
minute: minute,
second: second,
microsecond: 0,
);
}