Date Difference Calculator
Pick a start and end moment, optionally in different timezones, and read the time between two dates in every unit at once — plus a 'X years, Y months, Z days' breakdown.
What this duration calculator does
This is a date difference calculator. Pick a start moment, pick an end moment, and the tool reports the time difference in every unit at once — years, months, weeks, days, hours, minutes, seconds, and milliseconds. The headline number is a calendar breakdown like '3 years, 2 months, 14 days' so a finance team writing an anniversary clause and a developer counting days between two dates get useful answers from the same input.
How many days between two dates — the math
Total days is the simplest derived value: (end_epoch_ms − start_epoch_ms) / 86_400_000. The tool reports the unrounded floating-point value (so 1.5 days is honest about the remainder) and a rounded-down integer. For business contexts where weekends or holidays matter you usually want to start from this raw day count and subtract those manually, since 'business days' rules vary by jurisdiction.
- Total days between Jan 1 2024 00:00 UTC and Jan 1 2026 00:00 UTC = 731 (2024 is a leap year)
- Total days between Jul 4 2026 and Sep 1 2026 = 59 — paste both dates and read the 'Days' total
- Going negative is fine: the calculator marks end-before-start with a leading minus sign and a direction badge
Calendar breakdown vs total months / years
There are two ways to express 'how long': the calendar breakdown (e.g. '1 year, 2 months, 3 days') and the averaged totals ('1.18 years'). Calendar breakdown is what you write on a birthday card or a contract — it walks the actual calendar. Averaged totals divide elapsed milliseconds by a fixed average (365.2425 days per year, 30.437 days per month) and are useful when you need a single number for spreadsheets or charts. Both are shown side by side so neither audience has to think.
Time difference across timezones and DST
Each end of the interval has its own timezone picker. That matters whenever the two moments are stamped in different places — e.g. a flight that departs 09:00 LAX and arrives 13:30 JFK has a duration of about 5h30m, not 4h30m. The tool computes both endpoints as UTC instants under the hood, so daylight-saving transitions on either side are handled automatically. If both endpoints fall inside the same DST period there's nothing to think about; if one crosses a transition, you get the calendar-correct answer.
How many days until — common search queries this answers
The same calculator answers the entire 'how many days until X' family of searches. Set Start to today (the 'Set to now' button auto-fills it), set End to your target date, and read the totals row. The breakdown line above the totals reads 'X years, X months, X days' which is what most countdown banners want to display anyway. For a permanent live countdown to a fixed event, the related Countdown tool at /countdown ticks every second.
- How many days until Christmas — End = December 25 at midnight, current timezone
- How many days until New Year — End = January 1 of next year
- How many days until a birthday — End = next occurrence of MM-DD, time 00:00
- How many days since you started a project — Start = the project's first commit date, End = now
Why averaged 'months' and 'years' have decimals
There is no single right value for 'X months between two dates' — May → June can be 28, 29, 30 or 31 days. The averaged total uses the Gregorian average (365.2425 days per year, divided by 12) so that two dates exactly one calendar year apart show 1.000 years and 12.000 months regardless of which year they straddle. If you want strict calendar arithmetic, read the calendar-breakdown column on the right; if you want a uniformly comparable number, read the totals column.
Working with the result programmatically
Need to embed this calculation in code? The two epoch milliseconds the tool computes from your inputs are the entire dependency — once you have them, the rest is arithmetic. Copy the Unix timestamps from the source-time and target-time displays of the regular timezone converter (or compute them with the language-specific snippets) and the duration math becomes one subtraction.
- JavaScript: const ms = endMs - startMs; const days = ms / 86_400_000;
- Python: from datetime import datetime, timezone; (end - start).total_seconds()
- SQL (PostgreSQL): EXTRACT(EPOCH FROM (end_ts - start_ts)) / 86400 AS days
- Go: end.Sub(start).Hours() / 24