Create an ISO date object in javascript

前端 未结 5 1582
遇见更好的自我
遇见更好的自我 2020-12-05 04:02

I have a mongo database set up. creating a new date object in mongoDb create a date object in ISO format eg: ISODate(\"2012-07-14T00:00:00Z\")

I am usi

5条回答
  •  隐瞒了意图╮
    2020-12-05 04:33

    try below:

    var temp_datetime_obj = new Date();
    
    collection.find({
        start_date:{
            $gte: new Date(temp_datetime_obj.toISOString())
        }
    }).toArray(function(err, items) { 
        /* you can console.log here */ 
    });
    

提交回复
热议问题