Monthly billing, pro-rata refunds and any schedule measured in months all need the same figure: how many months actually lie between two dates. Because calendar months have unequal lengths, this calculator does not simply count month names. It converts the date span into seconds and divides by a defined average month, which gives a fractional result you can use directly in money or time calculations.
To calculate months between two dates with this method, count the days from the start date to the end date, multiply by 86,400 seconds per day, then divide by 2,629,800 seconds in an average month. The result is a fractional number of average months: from Jan 1, 2022 to Jun 29, 2022, 179 days give 5.88 months. The start date is counted and the end date is not, unless you tick the Include end date option.
What formula converts a date span into months?
An average month is defined from an average year of 365.25 days, divided into twelve equal parts in seconds:
The tool's own equation handles the date span, with the end-date option contributing its stored value of 1 when checked and 0 by default:
The day count is converted with 86,400 seconds per day and divided by that average month:
Every constant in the chain comes from the calculator's own definitions:
| Quantity | Source calculation | Value |
|---|---|---|
| Seconds in a day | 60 × 60 × 24 | 86,400 |
| Seconds in an average month | 60 × 60 × 24 × 365.25 / 12 | 2,629,800 |
| Seconds in four average months | 60 × 60 × 24 × 365.25 / 3 | 10,519,200 |
| Days in four average months | 10,519,200 / 86,400 | 121.75 |
| Weeks in an average month | 2,629,800 / 604,800 | 4.348 |
Because the denominator is an average rather than a particular calendar month, the same number of days always produces the same number of months, whatever months the span crosses.
Worked example: the Jan 1 to Jun 29, 2022 billing gap
Suppose a monthly service ran from Jan 1, 2022 to Jun 29, 2022, and you need the pro-rata credit. Counting the days gives a period of 179 days between the two dates, with the end day excluded.
First convert the span to seconds: 86,400 secs/day × 179 days = 15,465,600 secs. Then divide by the average month: 15,465,600 secs / 2,629,800 secs = 5.88 months. So 5.88 average months have passed between those dates, and that is the multiplier to use for a monthly charge.
How do I use the months between two dates calculator?
- Enter the start date in the From field.
- Enter the end date in the To field.
- Read the interval in the Months between field; the calculator updates as soon as both dates are set.
The result field counts the start date but not the end date. Tick Include end date to add the closing day to the span. The option stores 1 when checked and 0 when not checked, which is exactly the value the tool's equation adds to the plain difference.
Frequently Asked Questions
Which date formats can I type into the From and To fields?
You can pick dates from the calendar widget or type a date directly. The accepted written forms include Jan 25, 2022; 25 Jan 2022; and 1 25 2022.
Can I see the result in a unit other than months?
Yes. The calculator shows the period between the two dates in months by default, and you can change the output to other time units such as days or weeks.
Does the calculator include the end date by default?
No. By default the span includes the start date but excludes the end date. The Include end date checkbox is the switch that changes that convention.
Why would I need a fractional month instead of whole months?
Monthly charges and pro-rata refunds are proportional to time, so a span of 179 days is worth 5.88 average months rather than a rounded five or six.
References
- The calculator's month definition: 60 secs × 60 mins × 24 hours × 365.25 days / 12 months = 2,629,800 secs.
- The source equation time_between = date2 - date1 + include_end_date and its 0 or 1 option values.
- Standard time conversions used above: 86,400 secs per day and 604,800 secs per week.