Calculate the exact duration between two timestamps — seconds, hours, days, and business days. Date picker or Unix input.
Timestamp Difference Calculator
// Exact duration between two timestamps — including business days.
Debugging a slow job, checking an SLA, or confirming how long a token lived all come down to one question: how much time passed between two moments? This calculator answers it instantly. Pick two dates with the date picker, or switch to Unix timestamps mode and paste raw epoch seconds from logs. The result shows the gap as seconds, minutes, hours, days, weeks, approximate months, approximate years, and business days — each card copies with one click, and Copy all results grabs the full breakdown for a ticket or chat.
The math happens in your browser tab. Log timestamps from production systems stay on your machine; nothing is posted to a server.
Internally both inputs become JavaScript Date objects and the tool takes the absolute difference in milliseconds. From that single number it derives every unit:
The summary line also tells you the direction (whether “To” is before or after “From”), a human relative phrase, and both endpoints as UTC strings so you can double-check what was compared.
Paste 1715429912 as “From” and 1715516312 as “To”. The first value is Saturday, May 11, 2024 at 12:18:32 UTC; the second is exactly 86,400 seconds later, Sunday, May 12, 2024 at 12:18:32 UTC. The calculator reports 86,400 seconds, 1,440 minutes, 24 hours, and 1 day. Because the start falls on a Saturday and the interval only covers the weekend, the business-day count is 0.
The date picker uses your browser’s local timezone. If you enter 09:00 in Casablanca and 09:00 in New York on two machines, those are different instants. When you copy values from server logs, prefer Unix mode: epoch seconds are timezone-free, so the difference is unambiguous. Switching to Unix mode also fills the date pickers with the equivalent local times, which is a handy sanity check.
Once you know the expected answer, reproduce it in your service. Subtracting two Unix timestamps in seconds gives elapsed seconds directly:
const from = 1715429912, to = 1715516312; // Unix seconds
const elapsed = to - from; // 86400
const hours = elapsed / 3600; // 24d := time.Unix(1715516312, 0).Sub(time.Unix(1715429912, 0))
fmt.Println(d, d.Hours()) // 24h0m0s 24Language pages have more patterns: JavaScript, Go, and the others linked from the Unix timestamp converter.
1715429912 from 1715516312000 produces a nonsense gap of tens of thousands of years. Normalize both sides to the same unit first — see Unix seconds vs milliseconds.Engineers use the diff calculator to compare a JWT’s iat and exp (token lifetime), to measure queue latency between “enqueued” and “processed” log lines, to check how many working days remain before a release, and to confirm the countdown behind a Discord relative timestamp for a community event.
Subtract the earlier value from the later one when both are in the same unit. For seconds, 1715516312 - 1715429912 = 86400, which is exactly one day. Switch this tool to Unix mode to see every unit at once.
The calculator steps through calendar days from the earlier date to the later one and counts Monday to Friday. Weekends are skipped; public holidays are not removed because they vary by country.
They are derived from elapsed days using average lengths (30.4375 days per month, 365.25 days per year). Real calendar months vary, so use calendar-aware code for billing or contract periods.
The date picker uses your browser’s local timezone. For values copied from logs or APIs, use Unix timestamps mode so the comparison is timezone-independent.
Yes. Paste the iat value as From and the exp value as To in Unix mode. The result is the token lifetime; the JWT decoder shows those claims if you only have the raw token.
No. Every difference is computed locally in your browser tab. Timestamps you paste are not sent to a server or stored.