# Create Timefield with current time zone

**URL:** <https://discuss.elastic.co/t/create-timefield-with-current-time-zone/203819>\
**Category:** Kibana\
**Created:** [October 16, 2019, 11:18am UTC](https://discuss.elastic.co/t/create-timefield-with-current-time-zone/203819 "2019-10-16T11:18:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chris4](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Chris4](https://discuss.elastic.co/u/Chris4)\
**Post date:** [October 16, 2019, 11:18am UTC](https://discuss.elastic.co/t/create-timefield-with-current-time-zone/203819/1 "2019-10-16T11:18:07Z")

</div>

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

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

---

<div class="post-metadata">

**Author:** ![rashmi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rashmi/32/16391_2.png) [@rashmi](https://discuss.elastic.co/u/rashmi)\
**Post date:** [October 16, 2019, 9:57pm UTC](https://discuss.elastic.co/t/create-timefield-with-current-time-zone/203819/2 "2019-10-16T21:57:28Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Bargs](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bargs/32/5429_2.png) [@Bargs](https://discuss.elastic.co/u/Bargs)\
**Post date:** [October 17, 2019, 5:01pm UTC](https://discuss.elastic.co/t/create-timefield-with-current-time-zone/203819/3 "2019-10-17T17:01:57Z")

</div>

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](https://www.elastic.co/guide/en/elasticsearch/painless/7.4/painless-datetime.html)

---

<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:** [November 14, 2019, 5:02pm UTC](https://discuss.elastic.co/t/create-timefield-with-current-time-zone/203819/4 "2019-11-14T17:02:01Z")

</div>

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