Answers for "string convert to datetime php"

PHP
11

php convert string to date

$time = strtotime('10/16/2003');

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

echo $newformat;
// 2003-10-16
Posted by: Guest on February-28-2020
0

convert date php

$var = '21/05/2012';
$date = str_replace('/', '-', $var);
echo date('Y-m-d', strtotime($date))
Posted by: Guest on December-01-2021

Code answers related to "string convert to datetime php"

Browse Popular Code Answers by Language