user1573690
user1573690

Reputation: 361

mongodb date converting issue

I am using mongoDB with morphia in java ,I am saving a value in date format

value before save : Wed Mar 14 03:09:23 IST 2012
after save in mongo : ISODate("2012-03-13T21:39:23Z")

Mongo adding some number of hours when it save , Is there any way to save this value as it is in date format

Thanks

Upvotes: 0

Views: 5734

Answers (1)

David Guo
David Guo

Reputation: 90

mongodb saves datetime as "UTC DateTime", which you can refer to the following link.

Dates - MongoDB

To use the date you stored, just convert it to you local time. you will get the original.

Upvotes: 2

Related Questions