I have a date string:
25/08/2012
And here I am trying to convert it to a DateTime object in order to store it in a MySQL database. My backend schema has DateOfPrint date columns ready to receive this data.
Here is what I tried:
$eventDate = DateTime::createFromFormat('d/m/y', $fecha->innertext); echo $eventDate;
The echo statement does not display anything on the screen, and when you try to save it to the database, nothing is saved in this column.
Any suggestions?
source share