Time & Dates
Day shift across midnight
Total minutes past midnight can be negative or exceed a day. Taking the floor of the division by the minutes in a day gives the day shift, and subtracting it back gives the clock within the day.
The Formula
day shift = floor(target minutes / 1440); local minutes = target minutes - 1440 x day shift
Total minutes past midnight can be negative or exceed a day. Taking the floor of the division by the minutes in a day gives the day shift, and subtracting it back gives the clock within the day.
| Symbol | Meaning | Unit | Notes |
|---|---|---|---|
| m_t | Total minutes | minutes | Target time as minutes, possibly out of range. |
| d | Day shift | days | How many days the destination has moved. |
| m_L | Local minutes | minutes | Minutes within the destination day. |
What Each Symbol Means
m_tminutes
Total minutes
Target time as minutes, possibly out of range.
ddays
Day shift
How many days the destination has moved.
m_Lminutes
Local minutes
Minutes within the destination day.
See It Worked With Real Numbers
A formula on its own does not tell you which number goes where. The how to convert time zones page applies this equation to a concrete case, shows every intermediate step, and names the mistakes that produce a wrong answer even when the algebra is right.
Where This Formula Appears
This equation is the working core of How To Convert Time Zones, filed under Everyday Life. Every number the guide produces comes from substituting into this one line.