# Why Elasticsearch query edit time zone

**URL:** <https://discuss.elastic.co/t/why-elasticsearch-query-edit-time-zone/55601>\
**Category:** Elasticsearch\
**Created:** [July 15, 2016, 8:22am UTC](https://discuss.elastic.co/t/why-elasticsearch-query-edit-time-zone/55601 "2016-07-15T08:22:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![JakeWoo](https://avatars.discourse-cdn.com/v4/letter/j/d6d6ee/32.png) [@JakeWoo](https://discuss.elastic.co/u/JakeWoo)\
**Post date:** [July 15, 2016, 8:22am UTC](https://discuss.elastic.co/t/why-elasticsearch-query-edit-time-zone/55601/1 "2016-07-15T08:22:54Z")

</div>

Hi, I'm running Elasticsearch 2.3.1 CentOS release 6.7 (Final). I'm here use +8 time zone .

question:  
Why save when using local time zone (+ 8), query according to time format string data is 0 time zone, but also automatically compensate time difference (query range cheap eight hours)

last is query and result.

thanks man!

1. query  
{  
"query": {  
"bool": {  
"must": [  
{  
"range": {  
"starttime": {  
"gt": "2015-12-01 00:00:00",  
"lt": "2015-12-01 03:59:59"  
}  
}  
}  
],  
"must\_not": ,  
"should":   
}  
},  
"from": 0,  
"size": 10,  
"sort": ,  
"aggs": { }  
}

2. result ![](https://us1.discourse-cdn.com/elastic/original/2X/4/42e1434fdd6270f6e59c969c8258483ff07a007f.png)  
1448940867000  
1448942308000  
1448931935000  
1448941252000  
1448939838000  
1448935642000

3. question  
{  
"query": {  
"bool": {  
"must": [  
{  
"range": {  
"starttime": {  
"gt": "2015-12-01 00:00:00",  
"lt": "2015-12-01 03:59:59",  
"time\_zone": "+08:00"  
}  
}  
}  
],  
"must\_not": ,  
"should":   
}  
},  
"from": 0,  
"size": 10,  
"sort": ,  
"aggs": {}  
}

2.result {  
"took": 3,  
"timed\_out": false,  
"\_shards": {  
"total": 5,  
"successful": 5,  
"failed": 0  
},  
"hits": {  
"total": 5,  
....(sorry result data is long long long )

1448910912000  
1448911531000  
1448906069000  
1448902504000  
1448911803000

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 5, 2017, 10:35pm UTC](https://discuss.elastic.co/t/why-elasticsearch-query-edit-time-zone/55601/2 "2017-07-05T22:35:19Z")

</div>


