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