Skip to main content
CodeLint.Dev Dev Tools

Date Calculator — Difference, Age & Business Days

Days, weeks, months or business days between two dates, and date addition that handles month-end correctly.

Date Calculator

Date difference, duration shift, Unix timestamps, and date info — all instant, all local.

Date Difference

ahead
0 days
0 weeks 0 days

Date Info

Day of week
Wednesday
ISO week
Week 36
Day of year
245 / 365
Quarter
Q3
Days in month
30 days
Leap year
No
From today
Today

Add / Subtract Duration

+ 30 days
Friday, October 2, 2026
− 30 days
Monday, August 3, 2026

Unix Timestamp

ISO 8601 2026-09-02T07:08:41.000Z
UTC Wed, 02 Sep 2026 07:08:41 GMT
Local 9/2/2026, 7:08:41 AM
1788307200

Business days between two dates

Counting weekdays by iterating day by day is correct but slow over long ranges. The closed form:

weekdays = (weeks × 5) + remainder adjustment

weeks
Whole weeks between the dates: floor(total days ÷ 7)
remainder
Leftover days: total days mod 7
adjustment
Of the remaining days, how many fall on a weekday — depends on which weekday the range starts

Worked example

From
Mon 1 Sep 2026
To
Fri 30 Oct 2026
Total days
59
Whole weeks
8 → 40 weekdays
Remaining 3 days
Mon–Wed → 3 weekdays

43 business days

Public holidays are not deducted. They vary by country, by region within a country, and sometimes by employer — so for a contractual deadline, check the specific calendar that applies.

Adding months is genuinely ambiguous

Adding days is unambiguous. Adding months is not, because months have different lengths and the answer depends on a convention you have to choose.

What is one month after 31 January? There is no 31 February. The three defensible answers are 28 February (clamp to month end), 3 March (overflow into the next month), or "undefined" (reject the operation).

Most date libraries clamp, which is usually what a human expects. But clamping breaks a property you might assume holds: it is not reversible. 31 January plus one month is 28 February; 28 February minus one month is 28 January, not 31. And adding one month twice is not the same as adding two months — 31 January + 1 + 1 gives 28 March, while 31 January + 2 gives 31 March.

This matters in practice for subscription billing and loan schedules. A subscription started on the 31st does not have a natural monthly anniversary, and different providers resolve it differently — some bill on the 28th thereafter, some on the last day of each month, some on the 1st. Financial contracts usually specify the convention explicitly for exactly this reason.

How age is calculated here

  • Complete yearsAge increments on the anniversary of the birth date, so someone born on 2 September 2000 is 25 on 1 September 2026 and 26 the following day. This is the near-universal Western convention and what legal age checks use.
  • Leap-day birthdaysSomeone born on 29 February has a legal birthday of 28 February or 1 March in non-leap years depending on jurisdiction. This calculator uses 1 March — the first day on which the full year has elapsed.
  • Years, months and daysComputed by subtracting years first, then months, then days, borrowing from the previous month where needed. This is why the "days" component varies with the length of that month.
  • Other conventions existEast Asian age reckoning traditionally counts a newborn as one and increments at new year, and some financial calculations use a 30/360 day count where every month is treated as 30 days. Neither is used here.

About

The Date Calculator covers three common date operations: calculating the exact difference (in days, weeks, months, and years) between two dates; adding or subtracting a duration from a date; and converting Unix timestamps to human-readable dates and back. All calculations run locally in your browser.

How to use

  1. 1 Select the Date Difference tab to find how many days are between two dates.
  2. 2 Use Add / Subtract to find a target date by adding a number of days, weeks, months, or years.
  3. 3 Use the Unix Timestamp tab to convert between epoch seconds and calendar dates.
Does the date difference calculation include or exclude the start and end dates?
The difference is calculated as the number of calendar days between the two dates, excluding the start date and including the end date — which is the standard convention for "days between." For example, the difference between 1 Jan and 3 Jan is 2 days.
What is a Unix timestamp?
A Unix timestamp (also called epoch time) is the number of seconds that have elapsed since 00:00:00 UTC on 1 January 1970. It is the standard way computers store and transmit dates internally, and is commonly seen in API responses, log files, and database records.
Can I add business days rather than calendar days?
The current Add/Subtract tab works with calendar days. To calculate business day offsets (excluding weekends), use the Date Difference result and manually subtract the number of weekend days, or use the built-in business-day mode if available.