0

I am saving current date in mongodb with new Date(new Date().toDateString()) and i give my field type Date. But mongodb is storing it like this.

2018-12-03T12:00:00.000-06:30

I want it to store with timezone and time equals to 00:

2018-12-03T00:00:00.000-00:00

How can i acheive it in mongodb?

  • Possible duplicate of [save only Date without timezone javascript](https://stackoverflow.com/questions/53608381/save-only-date-without-timezone-javascript) – str Dec 04 '18 at 09:50
  • it is posted by me and for javascript not for mongodb. –  Dec 04 '18 at 09:51
  • I know that. MongoDB handles JavaScript dates by storing them in their ISO 8601 representation. – str Dec 04 '18 at 09:51
  • so can you please tell me, how can i achieve the above? –  Dec 04 '18 at 09:53
  • There is a link in your own question which answers that for MongoDB. "not worked for me" is not specific enough for anyone to help. What exactly did you try? Show code. What exactly did not work? – str Dec 04 '18 at 10:10

0 Answers0