Loading...
Loading...
Calculate the exact difference between two times in hours, minutes, and seconds with cross-day support.
Hour (1-12 for 12h format, 0-23 for 24h format)
Minutes (0-59)
Seconds (0-59)
Hour (1-12 for 12h format, 0-23 for 24h format)
Minutes (0-59)
Seconds (0-59)
Enable if the end time is on the next day
Both times are converted to total seconds since midnight. The difference is computed as end minus start. For cross-day calculations, 24 hours (86,400 seconds) are added automatically.
Convert each time to total seconds since midnight
T = (hour × 3600) + (minute × 60) + second
= Time expressed in seconds
Handle 12-hour to 24-hour conversion
If PM: hour += 12, If 12 AM: hour = 0
= 24-hour format time
Subtract start from end (add 86400s if cross-day)
Diff = T₂ − T₁ + (crossDay ? 86400 : 0)
= Difference in seconds
Convert seconds back to hours, minutes, seconds
Hours = ⌊Diff / 3600⌋, Minutes = ⌊(Diff % 3600) / 60⌋, Seconds = Diff % 60
= Human-readable time difference
Choose between 12-hour (AM/PM) or 24-hour format using the toggle.
Enter the start time using the hour, minute, and second fields.
For 12-hour format, select AM or PM from the dropdown.
Enter the end time the same way.
Enable 'Next Day' if the end time is on the following day.
Results update instantly — hours, minutes, seconds, total minutes, and total seconds.
9:00 AM to 5:00 PM, same day
10:00 PM to 6:00 AM, cross midnight
08:30 to 17:45 in 24-hour format