Skip to main content
Date & Time

Time Between Two Times Calculator

Enter two clock times (HH:MM or HH:MM:SS) and instantly get the difference in hours, minutes and seconds — plus decimal hours, total minutes and total seconds. The default "auto-detect" mode handles overnight shifts by treating an end that is earlier than the start as the next day, ideal for graveyard-shift timesheets, concert runtimes or "how long can I sleep before my flight?".

Midnight handling

If the end is earlier than the start, treat it as the next day (good for overnight shifts).

hh:mm:ss

Decimal hours

Total minutes

Total seconds

Pure clock-time math, no date involved. For multi-day spans, use the Date Difference tool.

Formula

diff_seconds = (h₂·3600 + m₂·60 + s₂) − (h₁·3600 + m₁·60 + s₁) + 86 400 if mode = force, or (mode = auto AND diff < 0) hh:mm:ss = ⌊|diff| / 3600⌋ : ⌊(|diff| mod 3600) / 60⌋ : (|diff| mod 60) decimal_h = diff_seconds / 3600

Frequently asked

An overnight shift starts 22:30 and ends 06:45 the next morning — how many hours is that?

8 hours 15 minutes — i.e. 8.25 decimal hours. Leave the mode on "Auto-detect": because the end (06:45) is earlier than the start (22:30), the tool wraps around midnight and flips the "crosses midnight" badge on. If you subtract a 1-hour unpaid meal break the net work time is 7.25 h.

My payroll system wants decimal hours — how do I read that off?

After entering the two times, read the "Decimal hours" tile — that is your payroll number. Example: 09:00 → 17:30 shows 8.5 h, which is what most timesheet apps expect. To round to the nearest 0.25 h (the standard 15-minute payroll step), snap to .00 / .25 / .50 / .75.

What is the difference between Auto-detect and Force next day?

Auto-detect only adds 24 h when end < start strictly — daytime shifts (09:00 → 17:00) stay as one-day spans. Force next day always pushes the end onto the next calendar day, so 09:00 → 09:00 becomes 24 h. Use Force when you are billing a flat full-day rental of a car, meeting room or venue and the clock times happen to match.

A film runs 02:21:38 (e.g. Oppenheimer). Starting at 19:30, when does it end?

This tool computes the difference between two times, not "time + duration". Add 02:21:38 to 19:30:00 by hand and the film ends at 21:51:38. You can also use this tool in reverse: enter 19:30 and 21:52 and it shows a 02:22:00 gap, which lines up with the runtime.

Related tools

Age Calculator

From your date of birth, get exact age, Chinese nominal age (虛歲), days lived and days to next birthday.

Date Difference Calculator

Enter any two dates to get the calendar gap, working days, weekend days, plus year/month/day breakdown and total weeks/months.

Time Zone Converter

Pick your local and target cities to convert a given clock time across time zones.

Date Add / Subtract Calculator

Add or subtract years, months, weeks and days from a start date to get the resulting date and weekday.

Business Days Calculator

Count the working days between two dates (excluding weekends) — or add N business days to a start date to find the deadline.

Pregnancy Due Date Calculator

Estimate the due date from your last menstrual period (LMP) using Naegele's rule, plus current gestational week, trimester and key pregnancy milestones.

Time Card Calculator (clock-in / clock-out / break)

Enter clock-in/clock-out times and break minutes to get total hours worked and gross pay — overnight (graveyard) shifts handled automatically.

Day of Year & Week Number Calculator

Pick any date to see which day of the year (1–366), ISO 8601 week number, weekday, and how many days from the start and end of the year.

Day of the Week Calculator (Any Date)

Enter any Gregorian date (past or future) to instantly find the day of the week — useful for birthdays, anniversaries and historical events.

Unix Timestamp ↔ Date Converter

Convert a Unix timestamp (seconds or milliseconds since 1970-01-01 UTC) to UTC, Hong Kong time and RFC 1123 HTTP date — and back. Built for debugging log files, API responses and database fields.

Easter Date Calculator

Pick a year and the Computus algorithm returns Easter Sunday plus Ash Wednesday, Palm Sunday and Good Friday.

Moon Phase Calculator

Enter any date to compute the lunar phase (new, first quarter, full, last quarter …), moon age in days and illuminated fraction.

Chinese Zodiac & Lunar Age Calculator

Find your Chinese zodiac animal, stem-branch element, zodiac year and lunar (nominal) age from any birth date.

Western Zodiac Sign Calculator

Enter your birth date to see your Western zodiac sign (Aries, Taurus, Gemini…) along with its element, modality and opposing sign.

Birthstone Calculator

Pick a birth month to instantly see the modern and traditional birthstones, the birth flower, the spanning zodiac signs and a colour swatch — handy when choosing jewellery or birthday gifts.

Julian Day Number Calculator

Convert a Gregorian calendar date to its Julian Day Number (JDN) and Modified Julian Day (MJD) — used in astronomy, history, and cross-calendar date math.

ISO 8601 Week Number Calculator

Enter any date and compute its ISO 8601 week number, ISO year and weekday — using the Monday-first / first-week-contains-Jan-4 rule.

Hong Kong Statutory Annual Leave Calculator

Enter years of service and see the statutory paid annual leave entitlement under the HK Employment Ordinance §41AA.

Half-Birthday Calculator

Enter your date of birth to see when your next half-birthday falls, how many days away it is, and your current half-age (e.g. 33.5 years).

Daylight Hours (Sunrise / Sunset) Calculator

Enter a latitude, longitude and date to get the local sunrise, sunset, solar noon and total daylight hours using the NOAA solar position formula.