user3611783 user3611783 - 3 months ago 19
PHP Question

Parse.com 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 parse.com using parse PHP SDK ..

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


above is the
Print_r()
function result any help would be greatly appritiated

thanks in advance

Answer

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

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