# Time Zone

**URL:** <https://discuss.elastic.co/t/time-zone/6712>\
**Category:** Elasticsearch\
**Created:** [February 15, 2012, 11:45am UTC](https://discuss.elastic.co/t/time-zone/6712 "2012-02-15T11:45:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![yehuda](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yehuda/32/2164_2.png) [@yehuda](https://discuss.elastic.co/u/yehuda)\
**Post date:** [February 15, 2012, 11:45am UTC](https://discuss.elastic.co/t/time-zone/6712/1 "2012-02-15T11:45:20Z")

</div>

Hi,

I'm trying to use the time zone option within a date histogram, since the hour I get is greater than the hour saved in elastic (by 2 hours).  
I'm using 0.18.7.

This is my query:  
{"query":{"filtered":{"query":{"range":{"date":{"from":"2011-12-18","to":"2011-12-18"}}},"filter":[{"terms":{"ctid":["11"]}}]}},"facets":{"date\_sum\_stats":{"date\_histogram":{"key\_field":"date","value\_field":"sum","interval":"hour","time\_zone":-2}}}}

And it returns this:  
facets: {  
date\_sum\_stats: {  
\_type: date\_histogram  
entries: [  
{  
time: 1324184400000  
count: 2  
min: 5  
max: 10  
total: 15  
total\_count: 2  
mean: 7.5  
}  
{  
time: 1324188000000  
count: 1  
min: 35  
max: 35  
total: 35  
total\_count: 1  
mean: 35  
}  
]  
}

1324188000000 epoch is "08" in hours (doing Time.at(1324188000000 / 1000).strftime("%H")) but the document is saved with the hour "06":  
users  
new\_user  
370563565  
1  
IE  
US  
11  
2011-12-18T06:00:00+00:00  
35

Any ideas?  
I've tried also with 2 as time zone and with no time zone at all, but always getting same (wrong) hours.

Thanks,

Yehuda Zargarov

---

<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 6, 2017, 3:39am UTC](https://discuss.elastic.co/t/time-zone/6712/2 "2017-07-06T03:39:15Z")

</div>


