简体   繁体   中英

I can't get createdAt value form Parse(Back4App) by using PHP

Despite I use $object->getCreatedAt() function I cant fetch the createdAt column's values. Need help. Thanks in advance for all.

$tableFetch = new Database(); // This is my custom class structure
$subscriptions = $tableFetch->tableFetch("Subscribe");

for ($i = 0; $i < count($subscriptions); $i++) { 
     $object = $subscriptions[$i];
     $createdAt = $object->getCreatedAt();
}

Edit: I can get the information of array but cant slice it with keys.

I found the answer.

After creating DateTime Object need to specify format as below.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM