A worked example: adding 3 hours 40 minutes to 22:15
Starting at 22:15 and adding a duration of 3 hours 40 minutes produces a result time of 01:55, with the day-change output reading "+1 day." The calculator gets there by working entirely in minutes: 22:15 is 1,335 minutes into the day, and adding the 220-minute duration (3 hours 40 minutes) brings the running total to 1,555 minutes — past the 1,440-minute length of a single day, which is exactly why the result rolls over into the next one.
The formula: start time plus or minus a duration, wrapped to 24 hours
The underlying rule is: result = start time ± (hours × 60 + minutes), wrapped to a 24-hour clock. For the example above, the duration in minutes is (3 × 60) + 40 = 220, so the raw total is 1,335 + 220 = 1,555 minutes. Dividing 1,555 by 1,440 gives a day offset of 1 (found by taking the floor of the division), so the day-change output shows "+1 day," and the remainder after subtracting one full day's worth of minutes converts back to the displayed time of 01:55.
Another real example: subtracting time before dawn
Subtraction works the same way, just with the duration made negative before it's added. Starting at 06:20 and subtracting 1 hour 50 minutes gives a result of 04:30, with the day-change output reading "same day." In minutes, 06:20 is 380 minutes into the day; the 110-minute duration (1 hour 50 minutes) is subtracted to give a raw total of 270 minutes, which is still comfortably inside the same 0–1,439 minute window as the start time, so no day boundary is crossed.
Why the day-change indicator matters
A bare result time like "01:55" is ambiguous on its own — it could mean the calculation stayed on the same calendar day or rolled into the next one, and for anything involving shift schedules, flight arrival times, or overnight processes, that distinction changes which date the result actually belongs to. Reporting the day offset alongside the wrapped time removes the guesswork, so a result like "01:55, +1 day" can be read directly onto a calendar without the user having to re-derive whether midnight was crossed.