You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MongoDB [stores times in UTC by default](https://docs.mongodb.com/manual/reference/bson-types/#document-bson-type-date), and will convert any local time representations into this form.
5
+
Applications that must operate or report on some unmodified local time value may store the time zone alongside the UTC timestamp, and compute the original local time in their application logic.
6
+
7
+
#### For reconstructing the original local time you will have to apply the saved offset:
8
+
> **⚠ Note** <br>
9
+
TimeZoneOffSet is saved in seconds.
10
+
11
+
```javascript
12
+
var record =db.getCollection("mongoRisk").findOne()
13
+
var localTime =newDate(record.dateTime.getTime() +record.timeZoneOffset)
0 commit comments