$today = (new DateTimeImmutable())->setDate(2023, 10, 31)->setTime(0, 0, 0); $prevMonth = $today->sub(new DateInterval('P1M')); // subtract 1 month $nextMonth = $today->add(new DateInterval('P1M')); // add 1 month // prev month: 2023-10-01 // today: 2023-10-31 // next month: 2023-12-01
👍
2023.10.19 17:04