Skip to content

Seconds Between Two Dates

About this calculator

Calculate the exact number of seconds between two dates and times. This is the most precise time difference measurement available, useful for scientific calculations, performance benchmarking, and timestamp arithmetic.

How it works

The calculator parses both date-time inputs into JavaScript timestamps (milliseconds since January 1, 1970), takes the absolute difference, and divides by 1,000 to get seconds. Including specific times in your inputs allows for sub-day precision. The result is always a positive number regardless of which date comes first.

When to use this calculator

Programmers use seconds-between-dates for Unix timestamp math, cache expiration calculations, and API rate limiting. Scientists measure experimental durations in seconds for precise data analysis. Performance engineers benchmark system operations in seconds. It's also useful for calculating how many seconds are in unusual time spans — like how many seconds between two birthdays.

Examples

From midnight on January 1, 2020 to midnight on January 1, 2021 is exactly 31,622,400 seconds — a leap year, so 86,400 seconds longer than a common year.

Add specific times for precision: a process that starts at 09:00:00 and ends at 09:02:30 the same day spans exactly 150 seconds.

Common spans in seconds

How long familiar date ranges are when measured in seconds:

Date range Seconds
One week 604,800
One month (avg) 2,630,016
One year 31,557,600
One decade 315,576,000

Frequently asked questions

How many seconds are between two dates one day apart?

Exactly 86,400 seconds, since one day is 24 × 60 × 60 seconds. Two days apart is 172,800 seconds.

Does this account for leap years?

Yes. Because it counts the real elapsed time between the two calendar dates, any February 29 inside the range is automatically included, adding 86,400 seconds.

Why use seconds instead of days?

Seconds give maximum precision and match how computers store time as Unix timestamps. They are ideal for benchmarking, timeouts, and scientific timing.

← All date difference calculators