0

I'm trying to create Date Object to create a document in MongoDB with PHP.

I saw in PHP documentation new MongoDate() but I'm using the 'new' drivers MongoDB for PHP7 (this doc) and I can't use this.

I tried with MongoDB\BSON\Date but I got Class 'Date' not found

I searched across the new driver documentation & stackoverflow but nothing ...

Does anyone know how to create Date Object with the 'new' php driver ?

Bruno Toffolo
  • 1,504
  • 19
  • 24
Miwer
  • 3
  • 1

1 Answers1

0

The name of the class is \MongoDB\BSON\UTCDateTime: http://php.net/manual/en/class.mongodb-bson-utcdatetime.php

Derick
  • 35,169
  • 5
  • 76
  • 99