Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

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!!!
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #object #class #datetime #converted #string
ADD COMMENT
Topic
Name
6+1 =