# Timezone causing problem when doing a search query to an index!

**URL:** <https://discuss.elastic.co/t/timezone-causing-problem-when-doing-a-search-query-to-an-index/61077>\
**Category:** Logstash\
**Created:** [September 21, 2016, 5:10am UTC](https://discuss.elastic.co/t/timezone-causing-problem-when-doing-a-search-query-to-an-index/61077 "2016-09-21T05:10:50Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [September 21, 2016, 5:33am UTC](https://discuss.elastic.co/t/timezone-causing-problem-when-doing-a-search-query-to-an-index/61077/2 "2016-09-21T05:33:19Z")

</div>

The timezone will be stored as UTC, so if you want to get events during a calendar day in local time you have to adjust your query accordingly. If you make the query using the query DSL rather than a query string you can use a [range query](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-range-query.html) and set the timezone option to make ES do the timezone adjustment for you.

---

_[View the full topic](https://discuss.elastic.co/t/timezone-causing-problem-when-doing-a-search-query-to-an-index/61077)._
