Skip to content

Commit 2318d61

Browse files
committed
2 parents 194bb8b + 72214a1 commit 2318d61

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

docs/en/faq.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Frequently Asked Questions
2+
3+
## Why my TimeZone is converted to UTC?
4+
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 = new Date(record.dateTime.getTime() + record.timeZoneOffset)
14+
```

docs/en/index.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ OpenLRW is a free and open source Learning Record Warehouse provided by the Aper
88
* [Administrator Guide](administrator/index.md)
99
* [Developer Guide](developer/index.md)
1010
* [API Reference](api/index.md)
11+
* [Frequently Asked Questions](faq.md)
1112
* [External Resources](resources.md)
1213

13-
14+

0 commit comments

Comments
 (0)