# How do I set timezone in a scripted field?

**URL:** https://discuss.elastic.co/t/how-do-i-set-timezone-in-a-scripted-field/235367
**Category:** Kibana
**Created:** [June 2, 2020, 3:38pm UTC](https://discuss.elastic.co/t/how-do-i-set-timezone-in-a-scripted-field/235367 "2020-06-02T15:38:53Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Hugo\_Pires](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hugo_pires/32/68069_2.png) [@Hugo\_Pires](https://discuss.elastic.co/u/Hugo_Pires)
#### Post date: [June 2, 2020, 3:38pm UTC](https://discuss.elastic.co/t/how-do-i-set-timezone-in-a-scripted-field/235367/1 "2020-06-02T15:38:53Z")

</div>

I use the following code

```auto
doc['time_start_ts'].value.hourOfDay

```

to get hour of day from a time field with **date** format.

How can I set the timezone in order get the correct value after Daylight Saving Time changes?

Thank you

---

<div class="post-metadata">

### Author: ![Hugo\_Pires](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hugo_pires/32/68069_2.png) [@Hugo\_Pires](https://discuss.elastic.co/u/Hugo_Pires)
#### Post date: [June 11, 2020, 9:49am UTC](https://discuss.elastic.co/t/how-do-i-set-timezone-in-a-scripted-field/235367/2 "2020-06-11T09:49:02Z")

</div>

Hello again

Is it possible to have some answer on this topic?

Thank you

---

<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: [July 9, 2020, 9:49am UTC](https://discuss.elastic.co/t/how-do-i-set-timezone-in-a-scripted-field/235367/3 "2020-07-09T09:49:16Z")

</div>

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