3v4l.org

run code in 300+ PHP versions simultaneously
<?php //Your starting date as DateTime $currentDate = new DateTime(date('Y-m-d')); //Add 1 month $currentDate->add(new DateInterval('P1M')); //Get the first day of the next month as string $firstDayOfNextMonth = $currentDate->format('Y-m-1'); echo $currentDate->getTimestamp();

preferences:
56.2 ms | 402 KiB | 5 Q