Create new DateTime object from string(15) in PHP
Description
The following code shows how to create new DateTime object from string(15).
Example
<?php/* w ww . j a va 2s . co m*/
$format = '!d';
$date = DateTime::createFromFormat($format, '15');
echo "Format: $format; " . $date->format('Y-m-d H:i:s') . "\n";
?>
The code above generates the following result.