# Inserting ISODate type objects into MongoDB

**URL:** <https://community.dreamfactory.com/t/inserting-isodate-type-objects-into-mongodb/3560>\
**Category:** Connecting to NoSQL\
**Created:** [January 11, 2017, 5:43am UTC](https://community.dreamfactory.com/t/inserting-isodate-type-objects-into-mongodb/3560 "2017-01-11T05:43:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gkeith](https://avatars.discourse-cdn.com/v4/letter/g/9f8e36/32.png) [@gkeith](https://community.dreamfactory.com/u/gkeith)\
**Post date:** [January 11, 2017, 5:43am UTC](https://community.dreamfactory.com/t/inserting-isodate-type-objects-into-mongodb/3560/1 "2017-01-11T05:43:15Z")

</div>

There seems to be a problem when attempting to insert dates through the MongoDB Rest API, both in the API docs and in a PHP script, where using either ‘new Date()’ or ‘ISODate(“yyyy-mm-ddThh:MM:ss.SSSZ”)’ results in ‘No record(s) detected in request.’

Using just the correctly formatted date (e.g. “2014-01-10T10:10:10.000Z”) as suggested [Inserting usable timestamps in Mongo](https://community.dreamfactory.com/t/inserting-usable-timestamps-in-mongo/546/7) does not work either, as it is not converted into the ISODate format, and so fails the Mongo validation on the collection (which requires {$type:“date”}).

Is it possible to insert a record with an ISODate field using PHP?
