utility calculator
Hours Between Dates Calculator
Calculate the exact hours, minutes, and days elapsed between two dates and times.
Select Start & End
Calculation Results
Formula
Duration math formula
Elapsed Hours = (End Timestamp - Start Timestamp) / 3,600,000 millisecondsTimestamps are calculated in milliseconds from January 1, 1970 UTC. Subtracting the start from the end yields the difference in milliseconds, which is then divided to return hours and days.
Step by step
How the calculation works
- 1Convert the start date and time into a millisecond timestamp.
- 2Convert the end date and time into a millisecond timestamp.
- 3Subtract the start timestamp from the end timestamp to get total elapsed milliseconds.
- 4Divide total milliseconds by 3,600,000 to find the decimal hours difference.
- 5Solve for days (total hours / 24) and modulo remainders to isolate exact days, hours, and minutes.
Example
Example date range calculation
Calculating hours from Monday Oct 12, 2026 9:00 AM to Thursday Oct 15, 2026 5:00 PM. The elapsed calendar time is exactly 3 days and 8 hours. 3 days × 24 hours/day = 72 hours. Add the remaining 8 hours to get a total of 80.0 elapsed hours.
Related guides
Learn more about this calculation
Guide
Time Calculation Guide: Adding, Subtracting, and Converting Durations Correctly
Learn how to add and subtract time durations, convert total minutes into hours and decimal hours, and understand what the current DTC time calculator does well and where you should switch to hours or date-based tools.
Guide
Date Arithmetic Guide: Differences, Deadlines, and Calendar Math
Learn how date arithmetic works, how the DTC date calculator measures elapsed days, and why calendar intervals, deadlines, and age-style borrowing need clear rules.
Duration Guide
Time Calculation Methods
Learn timestamp differences, base-60 arithmetic, and how elapsed hours differ from symbolic calendar calculations.