Inserting a date in mongodb

前端 未结 4 639
臣服心动
臣服心动 2020-12-31 06:55

I want to insert a date into a collection. I use the class MongoDate to create the date object:

$today = new MongoDate(strtotime(date(\'Y-m-d 00         


        
4条回答
  •  天涯浪人
    2020-12-31 07:27

    FYI: If you need date created for your object model.

    $date_created = new \MongoDB\BSON\UTCDateTime(time()*1000);
    

提交回复
热议问题