Lelifi·tools

Month Counter for Calendar Months and Days

A month counter adds up whole calendar months between two dates, then reports the leftover days. From January 15 to October 27, 2026 the span is 9 months and 12 days, which is 285 days, 9.36 average months and 203 weekdays. Calendar months follow the day of the month, not a fixed 30-day block.

Pick two dates to get whole calendar months, leftover days, total days, average months and weekdays, with both end-of-month conventions available.

By the Lelifi editors ·

Key takeaways

Days in each Gregorian month, with February in a leap yearThe vertical axis starts at 26 days so the 28 to 31 day spread is visible28303231Jan29Feb31Mar30Apr31May30Jun31Jul31Aug30Sep31Oct30Nov31Deccommon yearFebruary in a leap year, 29 daysTotal: 365 days, or 366 in a leap year
Days in each Gregorian month, with February split between its common-year and leap-year lengths.
January 15 to October 27, 2026: nine whole months plus 12 daysEach block is one anniversary step. The widths are proportional to the days in each block.Jan 1531 dFeb28 dMar31 dApr30 dMay31 dJun30 dJul31 dAug31 dSep30 dJan 15, 2026Oct 27, 2026nine anniversary dates: Feb 15 through Oct 1531 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 = 273 days, then 12 more days to October 27.The leftover 12 days are what a whole-month count throws away, and they are why 9 months and 0.36 of a month differ.
January 15 to October 27, 2026 broken into nine anniversary blocks and a 12 day tail.
On this page
  1. What a month counter counts
  2. Calendar months are not 30 days
  3. How the count works: anniversaries, not division
  4. The end-of-month problem: January 31 to February 28
  5. Leap years and February 29
  6. Thirty-day conventions in payroll and finance
  7. Monthly billing, leases and notice periods
  8. Checking a month count by hand

What a month counter counts

A month counter answers a narrower question than a date difference: how many whole calendar months fit between two dates, and how many days are left over. For January 15 to October 27, 2026 the answer is 9 months and 12 days, which is 285 days in total.

The count is built from anniversary dates rather than from division. January 15 plus one month is February 15, plus two months is March 15, and so on until October 15. That is nine steps, and October 15 to October 27 adds the twelve leftover days.

Dividing instead gives a different answer, and both answers are useful. If 285 days is treated as 9.36 months of 30.4375 days each, the result matches the calendar count to two decimal places, which is why the two methods agree for most purposes and disagree at the edges.

MeasureResult for January 15 to October 27, 2026How it is produced
Calendar months and days9 months 12 daysNine anniversary steps, then 12 leftover days
Total days285 daysDay subtraction on the calendar
Average months9.36 months285 divided by 30.4375
Thirty-day months9.50 months285 divided by 30
Weeks and days40 weeks 5 days285 divided by 7, remainder kept
Weekdays, Monday to Friday203 daysCounted from January 16 through October 27

Every figure in that table comes from the same two dates. The calculator above returns all of them at once, plus the weekday of each endpoint, so a lease or a billing cycle can be checked against the calendar rather than against a rule of thumb.

Calendar months are not 30 days

Twelve months do not have twelve equal lengths, and that single fact is behind most disagreement about what a month is worth. February is 28 days in a common year and 29 in a leap year, seven months run to 31 days, four run to 30, and the total is 365 or 366.

The averages follow from those totals. A year of 365.25 days divided by 12 gives 30.4375 days, the figure payroll systems and spreadsheet functions use for an average month. The exact Gregorian mean is 30.436875 days, because the calendar year averages 365.2425 days over a 400-year cycle rather than 365.25. Finance often uses a flat 30 days, which is 1.4 percent short of the real average. The NIST time and frequency division keeps the definitions behind those averages, including the length of the second and the structure of the civil day.

MonthDays, common yearDays, leap yearDays from January 1 to month end
January313131
February282959 or 60
March313190 or 91
April3030120 or 121
May3131151 or 152
June3030181 or 182
July3131212 or 213
August3131243 or 244
September3030273 or 274
October3131304 or 305
November3030334 or 335
December3131365 or 366

The cumulative column is the one to check a result against. If a count says a date fell 200 days into a year, the cumulative table narrows it to mid-July, and a result that points at April is wrong by a quarter.

How the count works: anniversaries, not division

The algorithm needs three things: the start date, the end date, and a rule for what to do when the day numbers do not line up. It runs in four moves.

First, take the difference in months between the two month positions: (end year - start year) x 12 + (end month - start month). Second, add that many months to the start date, clamping the day to the length of the target month if the start day does not exist there. Third, compare the result with the end date. If it has overshot, step back one month. Fourth, count the days between the anchor you landed on and the end date.

For January 15 to October 27 the month difference is 9, the anchor lands on October 15, and the remaining days are 12. The anchor chain below shows each step and the number of days it covers.

StepAnchor dateDays in the stepRunning total
0January 15, 202600
1February 15, 20263131
2March 15, 20262859
3April 15, 20263190
4May 15, 202630120
5June 15, 202631151
6July 15, 202630181
7August 15, 202631212
8September 15, 202631243
9October 15, 202630273
leftoverOctober 27, 202612285

The running total is the check that catches most errors. If the month blocks sum to 273 but the day subtraction says 285, the leftover 12 days were dropped somewhere between the two calculations.

The end-of-month problem: January 31 to February 28

The hard case is a start date at the end of a month. January 31 plus one month has no exact answer, because February has no 31st. Two conventions exist and both are defensible.

The clamping convention says the anniversary of the last day of a month is the last day of the next month. Under that rule January 31 to February 28 is one whole month, and the same logic makes August 31 to September 30 one month. Banks, lease agreements and most date libraries work this way, and the Python dateutil library reports exactly one month for that pair.

The strict convention says a month is only complete when the day number has been reached. January 31 to February 28 is then 0 months and 28 days, because the 31st never arrives in February. Spreadsheet functions that compare day numbers directly return this answer.

RangeClamping ruleStrict day rule
January 31 to February 28, 20261 month 0 days0 months 28 days
January 31 to March 1, 20261 month 1 day1 month 1 day
January 31 to March 31, 20262 months 0 days2 months 0 days
March 31 to April 30, 20261 month 0 days0 months 30 days
August 31 to September 30, 20261 month 0 days0 months 30 days
February 28 to March 31, 20261 month 3 days1 month 3 days

The two rules only disagree when the start day is larger than the end day inside a shorter month, so the difference is one month or 28 to 30 days, never more. Pick the rule the document names, and when it names none, say which one you used. The widget above has a selector for both, so the same pair of dates can be read either way.

Leap years and February 29

February 29 is the test case that breaks naive month arithmetic, because it exists in one year out of four and the date has no counterpart in the following year. A lease that starts on February 29, 2024 and runs twelve months ends on February 28, 2025 under the clamping rule, because the anniversary date does not exist.

The leap rule itself is simple to state and easy to get wrong at centuries. A year is a leap year if it is divisible by 4, unless it is divisible by 100, unless it is divisible by 400. That makes 2000 a leap year, 1900 and 2100 common years, and 2024, 2028, 2032 and 2036 leap years. The US Naval Observatory calendar FAQ sets out the same rule and the history behind it. The 400-year cycle holds 97 leap years rather than 100, which is what brings the average year to 365.2425 days.

RangeClamping ruleStrict day ruleNote
February 29, 2024 to February 28, 202512 months 0 days11 months 30 daysAnniversary date does not exist
February 29, 2024 to March 29, 202513 months 0 days13 months 0 daysDay 29 exists in March
February 28, 2024 to February 28, 202512 months 0 days12 months 0 daysNo adjustment needed
February 28, 2024 to February 29, 20240 months 1 day0 months 1 dayThe extra leap day
January 30, 2024 to February 29, 20241 month 0 days0 months 30 daysClamped to 29 days in February

Leap years also change the day count inside a range without changing the month count. A twelve month span that crosses February 29 is 366 days, and the same twelve month span a year later is 365. The month count stays at 12 in both cases, which is why a monthly figure derived from total days drifts by one day in four years.

Thirty-day conventions in payroll and finance

Payroll, bond markets and mortgage servicing each define a month differently, and the definitions are written into contracts rather than derived from the calendar. Four conventions cover most of it.

The 30/360 convention treats every month as 30 days and every year as 360, with adjustments when a date falls on the 31st. The actual/360 convention counts real days but divides by 360, which inflates the annual figure by about 1.4 percent. Actual/365 divides real days by 365, and actual/actual divides by the real length of the year in question. Only the calendar-month convention follows the day of the month.

ConventionDays for January 15 to October 27, 2026Year basisWhere it is used
30/360282360Corporate bonds, some mortgages
Actual/360285360Money market instruments
Actual/365285365Sterling and some government debt
Actual/actual285365 or 366Treasury notes
Calendar months9 months 12 daysNot applicableLeases, subscriptions, employment

Written notation adds a third layer. ISO 8601 encodes a duration as P1M for one month and P1Y2M3D for a year, two months and three days. The standard fixes the notation but not the arithmetic, so adding P1M to January 31 is left to the implementation and libraries disagree. PostgreSQL resolves the same problem by clamping to the end of the target month, so a date plus interval '1 month' moves January 31 to February 28 rather than to March 2. A timestamp in RFC 3339 form avoids the question entirely by pinning an instant, which is why logs and APIs prefer instants while leases and invoices prefer calendar months.

The four day-count figures differ by three days on this range, which is small until the principal is large. On a million dollars at 5 percent, three extra days of accrual is about 417 dollars, and that is the sort of gap an auditor finds a year later.

YearLeap?Reason
1900NoDivisible by 100, not by 400
2000YesDivisible by 400
2024YesDivisible by 4
2028YesDivisible by 4
2100NoDivisible by 100, not by 400

Monthly billing, leases and notice periods

Most month counting is done for a practical reason, and the reason decides which convention applies.

A monthly subscription billed on the 31st hits a wall in February. Under the clamping rule the February charge falls on the 28th, and in a leap year the 29th, then returns to the 31st in March. Under the strict rule the February charge has no anniversary at all, so the service either bills on the 28th anyway or bills 28 days later. The difference is one billing day per year, which is small per customer and large across a subscriber base.

Leases behave the same way but with higher stakes. A one-year lease from January 31, 2026 to January 31, 2027 covers 365 days. The same lease written as twelve monthly terms starting on the 31st has a February term that must be defined, and a lease that does not define it invites a dispute at the end of the term. Write the end date, not the number of months, when the start date is at the end of a month.

Notice periods are counted forwards from a delivery or a letter rather than between two known dates. A 30-day notice given on January 31 expires on March 2 in a common year, because February contributes 28 days and the count needs two more. A 30-day notice and a one-month notice are therefore different things, and a contract that uses the phrases interchangeably has a latent ambiguity.

One industry rejects calendar months on purpose. Retailers on a 4-4-5 calendar divide the year into quarters of 13 weeks, each split into months of 4, 4 and 5 weeks, so every month is 28 or 35 days and every quarter is identical. A 52-week year leaves one or two days over, so a 53-week year is inserted every five or six years. The result compares badly with a Gregorian month and perfectly with last year, which is the point: a merchandising team wants week 12 of this year against week 12 of last year, not March against March. Academic terms take a similar shortcut, with semesters of 15 or 16 weeks and shorter summer sessions squeezed between them.

Law has its own definition, and it is narrower than the everyday one. In England and Wales the Interpretation Act 1978 provides that a month means a calendar month, so a statutory period of one month runs from a date to the corresponding date in the next month rather than across 30 days. A notice served on January 31 therefore expires on February 28, and a notice served on the 30th expires on the 30th of the following month unless that month is shorter. Utility billing takes a third route: the meter is read on a cycle of roughly 28 to 33 days, the tariff is applied to the units used, and the standing charge is applied per day, so the bill for a long cycle is larger without the rate having changed at all.

Payroll runs into the same wall from the other side. A monthly cycle pays 12 times a year, a semi-monthly cycle 24 times, and a biweekly cycle 26 times with two extra paydays in most years. Employers who switch from semi-monthly to biweekly without adjusting the salary divide by 26 instead of 24 and cut each cheque by about 7.7 percent, then hand back the difference in the two three-payday months. None of that is a rounding error, it is the 24 versus 26 periods problem, and it belongs in the offer letter rather than in the payroll system.

Proration for a partial month uses the length of that specific month. A tenant who moves in on October 15 pays for 17 days of a 31-day month, which is 54.8 percent of the rent, not 15 of 30 days, which would be 50 percent. The 4.8 point gap is the same 31 versus 30 problem in a different place.

Checking a month count by hand

Three checks catch almost every bad month count, and each takes a few seconds.

Check the weekday first. Adding a whole number of months changes the weekday by 0, 1, 2 or 3 days depending on the month lengths crossed, so October 15, 2026 should fall on a Thursday and October 27 should fall on a Tuesday. If the endpoint weekday is wrong, the date arithmetic is wrong and the month count cannot be right.

Check the day total second. The month blocks plus the leftover days must equal the plain day subtraction. For the example above the blocks sum to 273 and the leftover is 12, which gives 285, matching the difference between January 15 and October 27.

Check the average third. Divide the total days by 30.4375 and compare with the month count. A result within about 0.6 of the whole-month figure is normal, because the leftover fraction cannot exceed one month. A result that is 1.5 months away means the range or the rule is wrong.

Those three checks are enough for a lease, an invoice or a benefits waiting period. They will not settle a dispute about which convention applies, and no arithmetic will. When two parties disagree about a month count, the disagreement is almost always about a definition rather than about a number.

Frequently asked questions

How many months is January 15 to October 27, 2026?

9 months and 12 days under the clamping rule, which is 285 days in total. The anniversary chain runs from February 15 to October 15, nine steps, and the leftover is 12 days.

Is a month 30 days or 30.4375 days?

Neither is a calendar month. A calendar month is 28, 29, 30 or 31 days depending on which one you mean. The 30.4375 figure is the average of 365.25 divided by 12, used for rough conversions.

How many days are in a year?

365 in a common year and 366 in a leap year. The Gregorian average is 365.2425 days, which comes from 97 leap years in every 400.

Is January 31 to February 28 one month?

It depends on the convention. Under the clamping rule it is exactly 1 month, because the last day of January maps to the last day of February. Under the strict day rule it is 0 months and 28 days.

How do I count months between two dates by hand?

Subtract the month numbers, then check the day. If the end day is smaller than the start day, subtract one month and count the leftover days from the previous anniversary.

Does a leap year change the month count?

It changes the day count but not the month count. A twelve month span that includes February 29 is 366 days, and the same span in a common year is 365.

How many months is 90 days?

About 2.96 average months, or exactly 3 months on a 30-day basis. In calendar terms 90 days from January 15, 2026 lands on April 15, which is exactly 3 months.

How many weeks are in a month?

Between 4 and 4.4. A 28-day February is exactly 4 weeks, while a 31-day month is 4 weeks and 3 days. The average is 4.35 weeks.

Why do banks use 30/360?

It makes interest accrual identical every month, so a bond coupon divides evenly by 12. The cost is that a 30/360 year is 360 days while the calendar year is 365 or 366.

How many months is a 12 week period?

About 2.76 average months. Twelve weeks is always 84 days, which is less than three calendar months because the shortest three-month span, February through April, is 89 days in a common year.

What is the difference between a month and a lunar month?

A calendar month is 28 to 31 days by convention. A synodic lunar month, from one new moon to the next, averages 29.53 days, which is why lunar calendars drift against the Gregorian one.

Does the calculator count the start date?

No. It counts the time between the two dates, so the start date is day zero. Counting both ends adds one day, which matters for hotel nights and rental days but not for month counts.

How many months is 1,000 days?

About 32.85 average months, which is 2 years and 8.85 months. In calendar terms 1,000 days from January 1, 2026 lands on September 27, 2028.

What is a month-end anniversary?

It is the mapping of the last day of one month to the last day of another. January 31 plus one month gives February 28 in a common year and February 29 in a leap year.

Spotted a wrong number or a broken result?

More Date Time tools

See all Date Time tools

Fee schedules, rates and rules change without notice. Always confirm important figures with the official source before you rely on them.