There’s a number of functions out there for calculating the length of time in months but they only provide integer results. MySQL can do it too, for instance. But what if you need to get a precise number?
2008-11-15 minus 2008-10-01 can’t be one if you’re calculating rent. It must be 1.466…
-
span class=”st0″>’-‘‘-‘// number of months since the beginning of our calendar
-
$startMonth +
-
// month number
-
"t"// day number divided by the number of days in that month
-
"t"
Note: end date is not inclusive.