Answers for "create datetime from string php"

PHP
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

Convert String to Date and Date-Time in PHP

phpCopyecho $dateNew = DateTime::createFromFormat('m-d-Y', '03-08-2020')->format('Y/m/d');
//output: 2020/03/08
Posted by: Guest on April-23-2021

Code answers related to "create datetime from string php"

Browse Popular Code Answers by Language