Date difference calculator
Days between two dates with a working-day breakdown: calendar years/months/days, total months and days, whole weeks, weekdays and weekend days, plus hours, minutes and seconds — pure calendar maths, time zone independent.
Runs in your browserEvery computation happens in your browser — your data never leaves this device.
Dates
Dates are handled as whole calendar days and are independent of the local time zone. Accepted: YYYY-MM-DD, YYYY/MM/DD, DD.MM.YYYY, MM/DD/YYYY, optionally followed by HH:mm:ss.
Difference
Fill in two dates, then press “Calculate difference”.
What this tool does
- Work out how many days really lie between two dates — trip length, billing cycle, project duration — with total days and whole weeks in one glance.
- Check a claim or a leave request against working days: the result lists weekdays and weekend days over the half-open range [earlier date, later date) so they always add up to the total.
- Get month-end and leap-day cases right: 31 January 2024 to 29 February 2024 is “1 month 0 days”, while the same dates in 2023 clamp to 28 February.
- Schedule across time zones or contract start/end dates where only calendar dates matter: every calculation uses integer day numbers, so the local time zone and daylight saving never enter the picture.
Example
Input
Start date 2024-01-31, end date 2024-02-29
Output
Calendar difference: 1 month 0 days; total months 1; total days 29; whole weeks 4; weekdays (Mon–Fri) 21; weekend days (Sat, Sun) 8; hours 696; minutes 41760; seconds 2505600
Weekdays and weekend days are counted over the half-open range [2024-01-31, 2024-02-29), so the end date itself is excluded and weekdays + weekend days equals the total.
Frequently asked questions
Which date formats are accepted?
2024-02-29, 2024/2/9, 29.02.2024 and 02/29/2024 all work, and a time may follow the date, for example 2024-01-01 06:30:15. The separator decides the order: dots mean day.month.year, while slashes mean year/month/day when the first part has four digits and month/day/year when the last part does.
Why is 31 January to 29 February “1 month 0 days”?
Because shifting by whole months clamps the day to the last day of the target month: 2024-01-31 plus one month is exactly 2024-02-29, the end date, so no days are left over. In 2023 the same shift lands on 2023-02-28. Seen as total days it is simply 29 days (28 in 2023) — two views of one fact.
What happens when the end date is earlier than the start date?
All numbers are reported as absolute values and the direction gets its own row (“End date is before the start date”), so days and weeks never turn negative. Add the minus sign yourself if you need a signed count.
How are weekdays and weekend days counted?
Day by day over the half-open range [earlier date, later date), splitting Monday–Friday from Saturday–Sunday. The end date is not included, which is why weekdays + weekend days always equals the total. To include both endpoints, move the end date one day later.
Does the result depend on my time zone or daylight saving?
No. Everything runs on integer day numbers (Howard Hinnant’s days_from_civil algorithm) rather than Date objects, so the same input gives the same answer in every time zone and season — including the day a daylight saving change happens.
Keywords:date diffdate differencedays between datesdate durationweekdays between dates日期计算日期差值天数差两个日期相差几天工作日日期差计算日期相差天数