I inserted a DateTime
in MongoDB,
how to reconstruct this object?
$mongo->insert(array('time' => new DateTime()));
Output when using find
is:
[time] => Array
(
[date] => 2014-10-26 23:11:29.000000
[timezone_type] => 3
[timezone] => Europe/Berlin
)
I know I can use
DateTime::createFromFormat(...);
But is there a more convenient way?