user3611783 user3611783 - 2 months ago 11x
PHP Question class date object to string in php

i have tried

new DateTime()
function conver_from_format function and many more but i'm unable to convert date class object to convert in readable form im fetching it from using parse PHP SDK ..

DateTime Object (
[date] => 2016-08-22 00:00:00.000000
[timezone_type] => 2
[timezone] => Z

above is the
function result any help would be greatly appritiated

thanks in advance


If $date holds your DateTime object, you output it in a readable format like this:

echo $date->format('Y-m-d H:i:s');