# Format dates in response field in elastic search

**URL:** <https://discuss.elastic.co/t/format-dates-in-response-field-in-elastic-search/209836>\
**Category:** Elasticsearch\
**Created:** [November 28, 2019, 10:41am UTC](https://discuss.elastic.co/t/format-dates-in-response-field-in-elastic-search/209836 "2019-11-28T10:41:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![SRI\_SUSHMA\_Karra](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sri_sushma_karra/32/49309_2.png) [@SRI\_SUSHMA\_Karra](https://discuss.elastic.co/u/SRI_SUSHMA_Karra)\
**Post date:** [November 28, 2019, 10:41am UTC](https://discuss.elastic.co/t/format-dates-in-response-field-in-elastic-search/209836/1 "2019-11-28T10:41:59Z")

</div>

My server on which the application runs (uses ES) and ES are in central american time and I am accessing it from my server which is in IST.

I want some charts and data for today(Say Jan 3) so I send `from date` as today 12:00 AM to `to date` as current date in UTC to date range query. I get accurate number of records but I want the date to be shown as todays date alone(Jan 3), It gets divided between today(Jan 3) and yesterday(Jan 2) on client side access - ideally it should only todays date on client side for all records. Kibana renders correctly. So obviously there is a way and I am missing someting

I am using date range query - passing UTC for both to and from date and timezone offset as well.

Also, I am querying on a field which is of default type Date.I have not specified any custom date formats

Can somebody pleas help me with this?

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [November 28, 2019, 1:05pm UTC](https://discuss.elastic.co/t/format-dates-in-response-field-in-elastic-search/209836/2 "2019-11-28T13:05:54Z")

</div>

kibana allows to have special formatters for date fields, that take a timezone into account. If you want to do something like that in your own application, you have to implement this yourself, as Elasticsearch is not doing any formatting,

Hope this helps!

---

<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:** [December 26, 2019, 1:05pm UTC](https://discuss.elastic.co/t/format-dates-in-response-field-in-elastic-search/209836/3 "2019-12-26T13:05:59Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
