sodcalculator

08 Everyday Math

Date Calculator NZ: Work Out Days Between Dates

Tag 08-2873 · Updated · Standard formula, shown below

The calculator on this page is switched off while it is checked. The formula is below, and the worked example shows how to do the sum by hand.

This calculator works out the number of days, weeks, or months between two dates, or the date that falls a set number of days before or after a given date. You enter a start date and an end date (or a start date and a number of days), and you get the exact span in days, weeks, and months, plus the calendar date if you’re adding or subtracting. It’s built for New Zealand date formats (day/month/year) but works the same anywhere in the world.

Formula

The core calculation is simple date arithmetic. For the days-between calculation:

Days between = End date − Start date

Each date is converted to a serial number (the number of days since a fixed reference point, e.g., 1 January 1900). Subtracting the two serial numbers gives the exact number of whole days between them. The result is positive if the end date is after the start date, negative if it’s before.

For weeks: Weeks = Days between ÷ 7, rounded to one decimal place.

For months: Months = Days between ÷ 30.4375, rounded to one decimal place. The divisor 30.4375 is the average number of days in a month over a full year (365.25 ÷ 12). This gives a useful approximation, but note that calendar months vary from 28 to 31 days, so the month figure is an average, not an exact count of calendar months.

For adding or subtracting days: New date = Start date + (Days to add/subtract). A positive number moves forward, a negative number moves backward.

Worked Example

Using the default values from the calculator above:

  • Start date: 1 January 2024
  • End date: 31 December 2024
  • Days to add/subtract: 0

First, convert both dates to serial numbers. For simplicity, we can count the days between them directly:

2024 is a leap year (divisible by 4, not by 100 unless also by 400), so it has 366 days. From 1 January to 31 December is the full year, so the difference is 365 days (because the end date is exclusive – from Jan 1 to Dec 31 is 364 days if you count the start, but the calculator counts the span as end minus start, which gives 365 days when you include both endpoints).

Let’s verify: The calculator’s serial date system (e.g., Excel or similar) gives:

  • 1 Jan 2024 = serial 45292
  • 31 Dec 2024 = serial 45657
  • Difference = 45657 − 45292 = 365 days

So the calculator shows 365 days between those dates.

Weeks: 365 ÷ 7 = 52.1 weeks (rounded to one decimal).

Months: 365 ÷ 30.4375 = 12.0 months (rounded to one decimal).

New date: start + 0 days = 1 January 2024.

How to Use the Date Calculator

Enter your start and end dates in the format shown (YYYY-MM-DD is the safest for unambiguous calculation). The calculator immediately shows:

  • Days between – the total number of days, including both the start and end days if you think of it as a span. For example, from Monday to Friday is 4 days if you count only weekdays in between, but the calculator gives 4 days because it subtracts the dates (Friday serial minus Monday serial = 4). If you want to include both endpoints, add 1.
  • Weeks between – the days divided by 7, useful for planning work rosters or rental periods.
  • Months between – the days divided by the average month length, useful for rough estimates of age or contract duration.
  • New date – if you enter a non-zero number in the “Days to add/subtract” field, this shows the resulting date. For example, starting 1 January 2024 and adding 90 days gives 31 March 2024 (since 2024 is a leap year, Jan has 31, Feb has 29, and 90 − 31 − 29 = 30, so March 30? Let’s check: Jan 1 + 90 days = April 1? Actually, Jan 1 + 90 days: Jan has 31 days, so Jan 1 + 30 = Jan 31 (that’s 30 days). +31 more = March 1 (that’s 61 days). +29 more = March 30 (that’s 90 days). So the result is 30 March 2024. The calculator would show that.

Common Mistakes and How to Avoid Them

Date calculations are easy to get wrong. Here are the most frequent pitfalls:

  • Counting the start day twice. If you want the number of days from January 1 to January 2, the calculator gives 1 day, not 2. Many people think “from the 1st to the 2nd” is two days because both dates are included. The calculator uses the mathematical difference (end − start), which is the number of 24-hour periods between them. If you need inclusive counting, add 1 to the result.
  • Leap years. February has 29 days in leap years (divisible by 4, except century years not divisible by 400). Forgetting this can shift a date by one day. The calculator automatically handles leap years because it uses a serial date system that accounts for them.
  • Day/month/year confusion. In New Zealand, dates are written as DD/MM/YYYY, but the calculator uses YYYY-MM-DD to avoid ambiguity. Entering 03/04/2024 could mean 3 April or 4 March depending on the format. Always use the ISO format shown.
  • Rounding months. The month figure is an average. If you need exact calendar months (e.g., from 15 March to 15 June), count them directly instead of using the average.

When to Use This Calculator

This tool is handy for many everyday situations in New Zealand and elsewhere:

  • Working out how many days until a holiday, birthday, or event.
  • Calculating the length of a rental agreement or employment contract.
  • Determining due dates for bills or invoices (e.g., “net 30 days”).
  • Figuring out the exact age of a child in days or weeks for milestone tracking.
  • Planning project timelines – if you start on a date and need to know the end date after adding 45 working days (though this calculator counts all days, not just weekdays).

For working days (Monday to Friday), you’d need a separate business-day calculator that skips weekends and public holidays. This calculator gives raw calendar days.

Limitations of the Formula

The calculator uses a standard proleptic Gregorian calendar, which extends the current rules backward and forward. This is fine for dates from 1900 onwards, which are the default limits. For dates before 1582 (when the Gregorian calendar was introduced), historical accuracy is complicated because different countries adopted it at different times. New Zealand uses the Gregorian calendar, so for any practical purpose, dates from 1900 onward are correct.

The month calculation is an average, not an exact count of calendar months. If you need to know “how many full months” between two dates, you should count them manually or use a specialised date-difference function that considers the day of the month.

Also note that the calculator does not account for time zones or daylight saving time. It treats each day as exactly 24 hours, which is fine for calendar dates but not for precise time differences across time zones.

Alternatives and Related Calculations

If you need more specific date math, consider:

  • Working days calculator – counts only weekdays, excluding weekends and optionally public holidays. Useful for business deadlines.
  • Age calculator – gives age in years, months, and days from a birth date to today.
  • Date and time difference – includes hours, minutes, and seconds, useful for event planning or logging.
  • Excel DATEDIF function – if you’re working in a spreadsheet, you can use =DATEDIF(start, end, “d”) for days, “m” for months, “y” for years.

For most everyday needs, this simple day counter is all you need.

Frequently Asked Questions

Does the calculator include the end date in the count?

No. The result is the difference between the two dates (end − start). If you want to include both the start and end days, add 1 to the result. For example, from 1 January to 3 January is 2 days by difference, but if you’re counting the 1st, 2nd, and 3rd as three days, add 1.

How do I calculate the date 90 days from today?

Enter today’s date as the start date, enter 90 in the “Days to add/subtract” field, and leave the end date as is (or set it to the same as start). The “New date” output will show the date 90 days later.

Why does the month result show 12.0 for a full year?

Because the calculator divides the number of days by the average month length (30.4375). A year has 365.25 days on average, and 365.25 ÷ 30.4375 = 12.0. So it’s correct on average, but a specific span like 1 January to 1 February is 31 days, which would show as 1.0 months (31 ÷ 30.4375 ≈ 1.0).

Can I use this for dates before 1900?

The calculator’s minimum is 1 January 1900. For earlier dates, you’d need a different tool, but for most practical purposes, dates before 1900 are rare in everyday calculations.

Does it account for leap years?

Yes, the serial date system automatically includes leap years. For example, from 1 January 2024 to 1 January 2025 is 366 days because 2024 is a leap year.

What if I enter the end date before the start date?

The calculator will show a negative number of days, which is mathematically correct. If you always want a positive result, swap the dates. The calculator does not automatically swap them.

Related

Formula used
in start | Start date | - | 2024-01-01 | 1900-01-01 | 2100-12-31
in end | End date | - | 2024-12-31 | 1900-01-01 | 2100-12-31
in days | Days to add/subtract | - | 0 | -100000 | 100000
out days_between | Days between | days | end - start | 0
out weeks_between | Weeks between | weeks | (end - start) / 7 | 1
out months_between | Months between | months | (end - start) / 30.4375 | 1
out new_date | New date | - | start + days | 0

Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.

More in this bed

The whole Everyday Math bed →