Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
xchopin committed Feb 25, 2019
2 parents 194bb8b + 72214a1 commit 2318d61
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
14 changes: 14 additions & 0 deletions docs/en/faq.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Frequently Asked Questions

## Why my TimeZone is converted to UTC?
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.
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.

#### For reconstructing the original local time you will have to apply the saved offset:
> **⚠ Note** <br>
TimeZoneOffSet is saved in seconds.

```javascript
var record = db.getCollection("mongoRisk").findOne()
var localTime = new Date(record.dateTime.getTime() + record.timeZoneOffset)
```
3 changes: 2 additions & 1 deletion docs/en/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ OpenLRW is a free and open source Learning Record Warehouse provided by the Aper
* [Administrator Guide](administrator/index.md)
* [Developer Guide](developer/index.md)
* [API Reference](api/index.md)
* [Frequently Asked Questions](faq.md)
* [External Resources](resources.md)



0 comments on commit 2318d61

Please sign in to comment.