Number of Days Calculator
This answers how many days are in a single named period rather than between two dates: a month, a quarter or a whole year. It is a different question from a gap between two dates, and it comes up constantly in billing, rostering and reporting. A monthly subscription billed daily needs the month length. A quarterly report needs the quarter length. A payroll accrual needs the days in the year, which is 365 or 366 depending on where you are standing. February is the one that catches people, because a leap year adds a day under a rule most manual calculations get wrong. A year is a leap year if it divides by four, except century years, which must also divide by 400. That is why 2000 was a leap year and 1900 was not, and why 2100 will not be. Alongside the total you get the working days and weekend days in the period, which is the figure that matters for capacity planning, since a 31 day month with five weekends contains meaningfully less working time than a 30 day month with four.
Working days exclude weekends but not public holidays, which vary by region in New Zealand. Leap years follow the full Gregorian rule including the century exception.
How it works
For a month, the day count is found by asking for day zero of the following month, which returns the last day of the one you wanted. For a quarter, the three months are added together. For a year it is 365, or 366 in a leap year. Working and weekend days are counted by stepping through every day in the period and testing whether it falls on a Saturday or Sunday. The leap year test is the full rule: divisible by four, and if it is a century year, also divisible by 400.
Worked example
Take the defaults, February 2026. The year 2026 divides by four with a remainder, so it is not a leap year and February has 28 days. Stepping through those days gives 20 working days and 8 weekend days, which is four complete weeks. Compare that with February 2024, a leap year, which had 29 days. Over a quarter the effect compounds: the first quarter of a leap year is 91 days rather than 90, which matters for anything billed or accrued daily.
Related calculators
- Days Between Dates: a gap rather than a named period.
- Business Days: working days with holidays removed.
- Week Calculator: week numbers and weeks between dates.
- Calendar: facts about a single date.