# I have wrote a query in elastic search, but it shows data ffrom 5:00 am only.Before that 12:00 AM to 04:00 AM data, it does not shows.Why it it like that only?it is problem due to time -zone or what?Kindly provide some suggestions.I am pasting query:

**URL:** <https://discuss.elastic.co/t/i-have-wrote-a-query-in-elastic-search-but-it-shows-data-ffrom-5-00-am-only-before-that-12-00-am-to-04-00-am-data-it-does-not-shows-why-it-it-like-that-only-it-is-problem-due-to-time-zone-or-what-kindly-provide-some-suggestions-i-am-pasting-query/109347>\
**Category:** Elasticsearch\
**Created:** [November 28, 2017, 9:18am UTC](https://discuss.elastic.co/t/i-have-wrote-a-query-in-elastic-search-but-it-shows-data-ffrom-5-00-am-only-before-that-12-00-am-to-04-00-am-data-it-does-not-shows-why-it-it-like-that-only-it-is-problem-due-to-time-zone-or-what-kindly-provide-some-suggestions-i-am-pasting-query/109347 "2017-11-28T09:18:28Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [November 28, 2017, 9:41am UTC](https://discuss.elastic.co/t/i-have-wrote-a-query-in-elastic-search-but-it-shows-data-ffrom-5-00-am-only-before-that-12-00-am-to-04-00-am-data-it-does-not-shows-why-it-it-like-that-only-it-is-problem-due-to-time-zone-or-what-kindly-provide-some-suggestions-i-am-pasting-query/109347/2 "2017-11-28T09:41:56Z")

</div>

Please format your code using `</>` icon as explained in [this guide](https://discuss.elastic.co/t/about-the-elasticsearch-category/21). It will make your post more readable.

Or use markdown style like:

````
```
CODE
```

````

Elasticsearch always assumes UTC by default when you index a date (I mean **at index time** ).  
See [https://www.elastic.co/guide/en/elasticsearch/reference/6.0/date.html](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/date.html)

If you index `2015-01-01T12:10:30`, it assumes `2015-01-01T12:10:30Z`.

You can change the way you are indexing your dates by providing the right TimeZone like `2015-01-01T12:10:30+05:30`

Or you can use `offset`: [https://www.elastic.co/guide/en/elasticsearch/reference/6.0/search-aggregations-bucket-datehistogram-aggregation.html#\_offset](https://www.elastic.co/guide/en/elasticsearch/reference/6.0/search-aggregations-bucket-datehistogram-aggregation.html#_offset)

HTH

---

_[View the full topic](https://discuss.elastic.co/t/i-have-wrote-a-query-in-elastic-search-but-it-shows-data-ffrom-5-00-am-only-before-that-12-00-am-to-04-00-am-data-it-does-not-shows-why-it-it-like-that-only-it-is-problem-due-to-time-zone-or-what-kindly-provide-some-suggestions-i-am-pasting-query/109347)._
