I have a date in string format, that I am trying to get into MongoDB as a DateTime
type. The date-string is already in UTC, and is in the format 2017-11-30 19:41:00:677
.
When inserting into MongoDB, I am inserting the data:
{
"timestamp": new Date("2017-11-30 19:41:00:677"),
...
}
However, when I do this, the date is thought to be local time (it seems), and Mongo converts it to UTC by adding 4 hours. Yet the 19:41 is already in UTC.
How can I tell Mongo that the timezone is already in UTC?