创建日期对象MongoDB新的PHP驱动程序

时间:2016-03-17 10:02:19

标签: php mongodb php-7 mongodate

我正在尝试使用PHP创建日期对象以在MongoDB中创建文档。

我在PHP文档new MongoDate()中看到了,但我正在使用' new'驱动程序MongoDB for PHP7(this doc)并且我无法使用它。

我尝试使用MongoDB \ BSON \ Date,但我得到了Class 'Date' not found

我搜索了新的驱动程序文档& stackoverflow但没什么......

有没有人知道如何使用' new'创建日期对象? php驱动程序?

1 个答案:

答案 0 :(得分:0)