eval.in

Paste #735024

PHP — PHP 5.6.23, pasted 2 years ago (json)

1
2
3
4
5
<?php
$a_date = "2009-11-23";
$date = new DateTime($a_date);
$date->modify('last day of this month');
echo $date->format('Y-m-d');

Program Output

2009-11-30

OK (0.008 sec real, 0.009 sec wall, 14 MB, 43 syscalls)

Fork