Skip to content
gohacks.dev
Web

Date Difference Calculator

Count the days, weeks, business days and years, months and days between two dates, or add and subtract days, weeks, months, years or business days.

Free · No sign-up · Your inputs stay in your browser

Input

Days between dates, or a date plus a period

Output

66 days

Calendar difference

0 years, 2 months, 5 days

Days66
Weeks9 weeks and 3 days
Business days48
Hours1,584
Seconds5,702,400
End date is aFriday

Calendar dates in UTC, so a daylight-saving change never makes a day 23 hours long. Adding a month to the 31st lands on the last day of a shorter month (31 January + 1 month = 28 or 29 February), the same rule as Carbon's addMonthsNoOverflow() and date-fns addMonths. Business days skip weekends but not public holidays.

Runs in this browser. Nothing you paste is sent to a server.

Month arithmetic is a choice

January 31 plus one month has no right answer. This tool, date-fns' addMonths and Carbon's addMonthsNoOverflow() clamp to the last day of February; PHP's DateTime::modify('+1 month') and Carbon's plain addMonth() overflow into March 3 (or 2 in a leap year). Billing code should pick one behaviour on purpose.

Why UTC dates

Subtracting two local timestamps across a daylight saving change gives 23 or 25 hours for one 'day', and integer division then loses or gains a day. Calendar dates in UTC avoid it. Business days here skip Saturdays and Sundays only; public holidays differ by country and need a calendar.

Share

Frequently asked questions

Does it count the end date?
The difference counts days from the start to the end date, not including both ends: Monday to Friday of the same week is 4 days. Add one for an inclusive count.
How are business days counted?
Every Monday to Friday between the dates, regardless of public holidays.
Is what I paste sent anywhere?
No. The tool runs entirely in your browser with JavaScript. Nothing you type or paste is sent to our server or stored.

Keep planning

Similar tools