and it gets inserted in MongoDB as { "_id" : ObjectId("55ee83f94f01f37b95240f9c"), "datetime" : ISODate("2015-08-25T14:28:25.330Z") }
4 hours are being added to the timestamp. Can someone help me in finding the cause and solution for the same.
Derick Rethans
unread,
Sep 8, 2015, 5:03:28 AM9/8/15
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to mongodb-user
You are inserting time in *local* time, whereas MongoDB stores things in
*UTC* time. The "Z" at the end of the string in ISODate() says so.
Presumably, you're on a timezone that's 4 hours offset of UTC/GMT.
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to mongodb-user
Thanks Derick,
We are facing one more issue, We are inserting data in our MongoDB production server which is in UTC time zone, the server on which application is running to insert data is in "UTC-05:00" time zone. Ideally, the timestamp in MongoDB server after insertion should be the actual timestamp +5 hours. But what we are getting is actual timestamp +4 hours.
Asya Kamsky
unread,
Sep 9, 2015, 7:49:09 PM9/9/15
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to mongodb-user
Sounds like maybe the application machine isn't configured for
daylight savings time correctly?