Home » Php » How to retrieve the date of the document with timestamp with Firestore in PHP?

How to retrieve the date of the document with timestamp with Firestore in PHP?

Posted by: admin February 25, 2020 Leave a comment

Questions:

Hello i want to retrieve all my documents with a value timestamp but i get all the values without the column timestamp.

$json = [];
    $snapshot = $query->documents();
    foreach ($snapshot as $document) {
        if($document->exists())
        {
            $json[] = $document->data();
        }
    }
    return $json;

I need to add something else to retrieve documents with timestamp in PHP ?

Thanks

How to&Answers: