3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php echo date('Y-m-d 00:00:00', strtotime('first day of last month')). PHP_EOL; echo date('Y-m-d 23:59:59', strtotime('last day of last month')) . PHP_EOL; echo date('Y-m-d 00:00:00', strtotime('first day of this month')). PHP_EOL; echo date('Y-m-d 23:59:59', strtotime('last day of this month')) . PHP_EOL;
based on vNPrN
Output for 5.6.0 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.3.0alpha1
2017-05-01 00:00:00 2017-05-31 23:59:59 2017-06-01 00:00:00 2017-06-30 23:59:59