How in PHP do I get the regular timestamp format out of a MongoDB date?
PHP
MongoDB
Assume I have:
$my_date; print_r($my_date);
First, create date from millisecond using given function:
public function showdatefn($mili) { $seconds = (string)$mili / 1000; return date("d-m-Y", $seconds); } $date =$this->showdatefn();
This will give you correct date.