PHP Date

Last Updated: November 12, 2021

Converting from string to date

$time = strtotime('12/11/2003');

$newformat = date('Y-m-d',$time);

echo $newformat;

Get the end of the month

$a_date = "2009-11-23";
echo date("Y-m-t", strtotime($a_date));

t represents the end of the date

Test