Skip to content Skip to sidebar Skip to footer

Mongodb Date Time Value Not Storing Correctly

In here App Store date and time value in ISO 8601 format.but it storing some different value for Time. i save some time value 3.00 AM but it store mongodb like this 'start_time':

Solution 1:

Can you try to change this:

var date = newDate().toLocaleDateString("en-US");

To this?

var t = newDate();
var d = t.getDate();
var m = t.getMonth() + 1;
var y = t.getFullYear();

var date = m + '/' + d + '/' + y;

Or maybe the date is being changed to another timezone somewhere, though I am not sure where. You'll have to look that up.

I believe "2014-10-15T21:30:00.000Z", where Z = ZULU is UTC. What is your servers/mongo timezone?

Post a Comment for "Mongodb Date Time Value Not Storing Correctly"