user3611783 user3611783 - 1 year ago 178
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

Answer Source

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

echo $date->format('Y-m-d H:i:s');
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download