Format dates in response field in elastic search

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?

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!

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