I'm using [mongoose](http://mongoosejs.com/) with the following schema for ConfigItem:

```
var ConfigItem = new Schema({   
  name: {
    type: String,
    required: true
  },
  value: {
    type: String,
    required: false
  },
  date: {
    type: Date,
    required: false
  },
  user: {
    type: String,
    required: false
  }
});

```

Next, I have a function to save documents according to this schema:

```
function createConfigItem(_name, _value, _date, _user, callback) {
    var config = new ConfigItems({
        name: _name,
        value: _value,
        date: _date,
        user: _user
    });
    config.save(function handleSaveConfig(err) {
        if(callback){
            callback(err);
        }
    });
}

```

Next, I have an unit test (mocha based) which uses that function in the following way:

```
createConfigItem('sftpHost', '1.1.1.1', '2018-03-15 10:06:40.713', 'user1', callback);

```

If I run the test under mocha (see Note1) I get the following at MongoDB:

```
> db.configitems.find()
{ "_id" : ObjectId("5af173b1f155a4bff29f3e35"), "name" : "sftpHost", "value" : "1.1.1.1", "date" : ISODate("2018-03-15T10:06:40.713Z"), "user" : "user1", "__v" : 0 }

```

which is what I expect.

However, if I run using [istanbul](https://www.npmjs.com/package/istanbul) via grunt (see Note2) to get a coverage report the same invocation to createConfigItem() creates the following documenta at DB:

```
> db.configitems.find()
{ "_id" : ObjectId("5af176cbcffb8cc20a1fe3c2"), "name" : "sftpHost", "value" : "1.1.1.1", "date" : ISODate("2018-03-15T09:06:40.713Z"), "user" : "user1", "__v" : 0 }

```

Note that in this case the `date` field at DB is one hour shifted with regards the `_date` string parameter.

I was thinking it could be related with timezones in some way, but I have ensured that my process run in UTC setting `process.env.TZ = 'UTC'`.

I'm a bit lost... is there any known issue regarding mongoose/grunt/istanbul with regards to dates and/or timezones? Any hint about this problem, pls?

*Note1*: command used:

```
/home/fermin/.nvm/versions/node/v6.12.3/bin/node --debug-brk=50806 --expose_debug_as=v8debug /home/fermin/src/ctxmboard/node_modules/mocha/bin/_mocha --timeout 0 --ui bdd --reporter /home/fermin/.PyCharm2018.1/config/plugins/NodeJS/js/mocha-intellij/lib/mochaIntellijReporter.js --recursive /home/fermin/src/ctxmboard/test/back/unit

```

*Note2*: command used:

```
/home/fermin/.nvm/versions/node/v6.12.3/bin/node --debug-brk=33002 --expose_debug_as=v8debug ./node_modules/.bin/istanbul cover --root lib/ --dir site/coverage -- /home/fermin/.nvm/versions/node/v6.12.3/lib/node_modules/grunt-cli/bin/grunt test

```