Time duration

Calculate a duration in hours and minutes, on the same day or into the next day.

Minute-resolution wall-clock times, without dates or timezones. “Next day” adds 24 hours; midnight is never inferred automatically. Equal times give 0 hours on the same day or 24 hours the next day. Daylight-saving changes are not measured. Example: 23:30 → 01:00 next day = 1 h 30 min.

Your dates and times stay in your browser and are not stored.

Method and assumptions

Method version 1.0.0 · Updated

Clock duration

Formula: End minutes − start minutes + day offset

Minute-resolution wall-clock times, without dates or timezones. “Next day” adds 24 hours; midnight is never inferred automatically. Equal times give 0 hours on the same day or 24 hours the next day. Daylight-saving changes are not measured. Example: 23:30 → 01:00 next day = 1 h 30 min.

start
Start time
end
End time
day
End day

Gregorian calendar from years 0001 to 9999. Date, duration and rounding conventions are specified for each mode.

Calculate with code

These short examples use the same inputs and core calculation as this tool. Adapt validation and formatting to your application.

JavaScript
const minutes = (14 * 60 + 20) - (9 * 60 + 5);
console.log(`${Math.floor(minutes / 60)}h ${minutes % 60}m`); // 5h 15m
TypeScript
const minutes: number = (14 * 60 + 20) - (9 * 60 + 5);
console.log(`${Math.floor(minutes / 60)}h ${minutes % 60}m`); // 5h 15m
Python
start, end = 9 * 60 + 5, 14 * 60 + 20
minutes = end - start
print(f"{minutes // 60}h {minutes % 60}m")  # 5h 15m
Java
int minutes = (14 * 60 + 20) - (9 * 60 + 5);
System.out.printf("%dh %dm%n", minutes / 60, minutes % 60); // 5h 15m
C#
int minutes = (14 * 60 + 20) - (9 * 60 + 5);
Console.WriteLine($"{minutes / 60}h {minutes % 60}m"); // 5h 15m