Answers for "new datetime from string php"

PHP
2

pasar datetime a string php

$theDate    = new DateTime('2020-03-08');
echo $stringDate = $theDate->format('Y-m-d H:i:s');

//output: 2020-03-08 00:00:00
Posted by: Guest on March-27-2021
3

php datetime create

$date = DateTime::createFromFormat('d-m-Y', '15-12-2020');
Posted by: Guest on February-17-2020
1

create date from string php

$element = '15-Feb-2009';
$date = DateTime::createFromFormat('j-M-Y', $element);
Posted by: Guest on October-22-2020
0

pasar datetime a string php

$dateFormat = new DateTime(); // this will return current date
echo $stringDate = $date->format(DATE_ATOM);

//output: 2020-03-08T12:54:56+01:00
Posted by: Guest on March-27-2021
0

pasar datetime a string php

$date = date_create_from_format('d M, Y', '08 Mar, 2020');
echo $newFormat = date_format($date,"Y/m/d H:i:s");

//output: 2020/03/08 00:00:00
Posted by: Guest on March-27-2021

Browse Popular Code Answers by Language