Create Timefield with current time zone

"eventTime": [
"2019-10-16T11:14:43.000Z"

How can i, using e.g scripted field create an eventTime2 which gives me the time in a different timezone ?

Scripted fields are executed in Elasticsearch and Elasticsearch stores dates in UTC. Kibana does its timezone conversion in the browser, so Elasticsearch doesn't know anything about it. If you want to return the eventTime2 in a particular timezone you can use the Java date time APIs via Painless.

@Bargs let me know if this is right approach or if you can guide more here.

Thanks
Rashmi

Yes, you can find a guide for working with date fields in Painless here: https://www.elastic.co/guide/en/elasticsearch/painless/7.4/painless-datetime.html

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