Answers for "object of class datetime could not be converted to string"

PHP
0

object of class datetime could not be converted to string

// Must convert from DateTime to String
$tempDate = DateTime::createFromFormat('j-M-Y', '15-Feb-2009');
echo $tempDate->format('Y-m-d H:i:s');
// NOT echo $tempDate!!!
Posted by: Guest on September-10-2021

Code answers related to "object of class datetime could not be converted to string"

Browse Popular Code Answers by Language