MongoDB Time Data Model Note

<table class="text"><tr class="li1">
<td class="ln"><pre class="de1">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32

Local Time Convertion   Since MongoDB stores times in UTC by default,there is no worry when you store time,and MongoDB would convert your time to UTC time automatically.But the applications has the following situations where you should look after the conversion.           1) When provide time filter for query,local time is used here.            Take a example in CST,you should use 'new Date("2017-03-02T08:00:00+08:00")' in ISODate        format,and MongoDB would convert it to UTC time.                 2) When return result from query,the result should be in local time foramt.            Date object offers happy way to display UTC time in local time string format:        New Date().toString                    MongoDB Time Data Model Note

相关文章

文章浏览阅读552次。com.mongodb.MongoQueryException: Quer...
文章浏览阅读635次,点赞9次,收藏8次。MongoDB 是一种 NoSQ...
文章浏览阅读2.1k次。和。_mongodb 日期类型
文章浏览阅读1.7k次。Scalestack等客户期待使用MongoDB Atla...
文章浏览阅读970次。SpringBoot整合中间件mongodb、ES_sprin...
文章浏览阅读673次。MongoDB 简介_尚医通sql