everybody knows strtotime is buggy in and around february
first day +1month at the 29 30 31 January typically puts you in march 1 not Feb 1
last day of the month is not always 28 feb, may be march
I have a script for my own use, residential leases typically first day of next month till lastday of this month next year
function leaseyear() {
$mth = date('m');
$year = date('Y');
$result = strtotime("{$year}-{$mth}-01");
$start = strtotime('-1 second', strtotime('+1 month +1 day', $result));
$end = strtotime ('-1 second', strtotime('+1 month + 1 year', $result));
return date('jS M Y', $start).' to '.date('jS M Y', $end);
}
echo leaseyear();
what other patchworks have had to be made ?
supposed to be fixed in 5.3 already, but ...