[ACCEPTED]-PHP Fatal error: Class 'MongoDate' not found-lithium

Accepted answer
Score: 29

For people that have come here using PHP7, the 4 classs has been renamed:

MongoDate is now MongoDB\BSON\UTCDateTime

Also I've 3 found that this now wants miliseconds instead of seconds, so 2 make sure you multiple your input by 1000, for 1 example:

$date = new \MongoDB\BSON\UTCDateTime(strtotime('yesterday') * 1000);
Score: 3

Make sure your mongodb extension is loaded.


If not, you 1 must load it in php.ini.

More Related questions