Hello! I have 2 dates.
$ d1 = "2017-09-01"; $ d2 = "2017-09-30";
I think the difference between dates is as follows:
echo (int)abs((strtotime($d1) - strtotime($d2))/(60*60*24*30)); The question is how to correctly calculate the difference between dates, including all the nuances of the number of days in a month, since I would like to get a result in this particular case 1 - Ie 1 month, since from 1 to 30 September inclusively there is 1 month, but in fact I see 0 as if the month is not full, but if we count from 2017-09-01 to 2017-10-01, it will already be 1
2016-11-30 - 2017-03-01 выдаёт 2of the question on my link. Must 3 issue;) And from 1 to 30 is really not a full month, I agree with you. - Visman