Time & Date / calculator

Date calculator

Find days between dates, inclusive counts and Gregorian weekdays, or add and subtract calendar days and weeks using timezone-independent date arithmetic.

Calculator

Calculator

Choose an operation and enter your dates.

Use calendar dates in YYYY-MM-DD format. Differences are explicitly exclusive or inclusive; date arithmetic is time-zone independent.

Operation
Dates

Use an exact date such as 2024-02-29.

Used for date difference.

Difference counting

Your result

Enter details to see the result.

Complete the inputs and calculate to see the main result and its supporting breakdown.

Example

Worked example

Example inputs

Operation
Difference between dates
Start date (YYYY-MM-DD)
2024-01-01
End date (YYYY-MM-DD)
2024-01-31
Difference counting
Exclusive (do not count the start date)

Calculation breakdown

Weekday = (Gregorian civil day number + 4) modulo 7, normalized for pre-1970 dates. Date differences count whole calendar days. Exclusive mode counts the gap between dates; inclusive mode counts both the start and end dates. Add and subtract operations move by calendar days or seven-day weeks.

Exclusive / elapsed days
30
Inclusive calendar days
31
Weeks + days (exclusive)
4 weeks 2 days
Start / end weekdays
Monday / Wednesday

Example result

Exclusive date difference

30 days

Date-only arithmetic. No time zone or daylight-saving adjustment is applied.

How to interpret the result

Read the result according to the selected operation and counting mode. Inclusive differences count both boundary dates; exclusive differences do not count the starting date.

How to use this calculator

  1. Choose difference, add/subtract days or weeks, or day of the week.
  2. Enter YYYY-MM-DD dates; for a difference choose inclusive or exclusive counting, or for a shift enter days or weeks.
  3. Calculate and read the counting convention beside the resulting duration or date.

How it works

Formula

Weekday = (Gregorian civil day number + 4) modulo 7, normalized for pre-1970 dates. Date differences count whole calendar days. Exclusive mode counts the gap between dates; inclusive mode counts both the start and end dates. Add and subtract operations move by calendar days or seven-day weeks.

How do I calculate days between two dates?

The exclusive difference is the whole calendar-day gap between dates; inclusive counting adds a day to count both endpoints. Date-only arithmetic avoids daylight-saving hour changes, but it includes weekends and holidays.

What this calculator does

Choose a date operation, enter dates as YYYY-MM-DD, and see exactly how the calendar calculation is counted.

Who this is useful for

People comparing two calendar dates or finding a date a set number of days or weeks before or after another date.

Inputs you will need

Some inputs appear only for the operation or shape you select.

Required or selected inputs

  • Operation
  • Start date (YYYY-MM-DD) — Use an exact date such as 2024-02-29.
  • End date (YYYY-MM-DD) — Used for date difference.
  • Difference counting
  • Number of days or weeks

Assumptions

  • Dates are date-only values in YYYY-MM-DD format, not timestamps.
  • Date arithmetic does not depend on a browser time zone or daylight-saving transition.
  • Exclusive difference does not count the start date; inclusive difference counts both endpoints.

Limitations

  • This tool does not calculate elapsed hours or time-zone-aware durations.
  • It does not account for business days, holidays, or locale-specific calendars.
  • Dates outside the supported year range are rejected.

Useful next steps

For Monday-to-Friday counts rather than all calendar days, use Working days calculator.

For completed years, months, and days since birth, use Age calculator.

See how HandyChest handles units, validation, rounding, and testing, or Report a problem with this calculator.

Good to know

Frequently asked questions

What is exclusive date difference?

Exclusive difference counts the days after the start date up to the end date. January 1 to January 2 is 1 day.

What is inclusive date difference?

Inclusive difference counts both the start and end dates. January 1 to January 2 is 2 calendar days inclusive.

Does daylight saving time change the result?

No. This calculator works with calendar dates only, so daylight-saving and local-time transitions do not change the day result.

Keep going