# Scripted field with timezone

**URL:** https://discuss.elastic.co/t/scripted-field-with-timezone/120270
**Category:** Kibana
**Created:** [February 16, 2018, 10:57pm UTC](https://discuss.elastic.co/t/scripted-field-with-timezone/120270 "2018-02-16T22:57:37Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![sri\_harsha](https://avatars.discourse-cdn.com/v4/letter/s/919ad9/32.png) [@sri\_harsha](https://discuss.elastic.co/u/sri_harsha)
#### Post date: [February 16, 2018, 10:57pm UTC](https://discuss.elastic.co/t/scripted-field-with-timezone/120270/1 "2018-02-16T22:57:38Z")

</div>

Hi ,  
We are trying to create a scripted field as follows :  
doc['Timestamp'].date.hourOfDay  
The "Timestamp" is already in UTC format when we are ingesting the data.  
After the scripted field gets created , we applied it as a filter on the dashboard .  
But the fitlers dont work as expected and the values are skewed to accomodate for UTC conversion , which means another 6 hours is added .  
Eg : if I filter is to choose only the business hours and if I have 9 as the start and 18 as the end , it gets internally converted to 15 and 23 .

Thanks and Regards

---

<div class="post-metadata">

### Author: ![lukas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lukas/32/6812_2.png) [@lukas](https://discuss.elastic.co/u/lukas)
#### Post date: [February 16, 2018, 11:19pm UTC](https://discuss.elastic.co/t/scripted-field-with-timezone/120270/2 "2018-02-16T23:19:04Z")

</div>

Sounds like a bug. Could you report it as an issue on GitHub? Thanks!

---

<div class="post-metadata">

### Author: ![sri\_harsha](https://avatars.discourse-cdn.com/v4/letter/s/919ad9/32.png) [@sri\_harsha](https://discuss.elastic.co/u/sri_harsha)
#### Post date: [February 18, 2018, 8:28pm UTC](https://discuss.elastic.co/t/scripted-field-with-timezone/120270/3 "2018-02-18T20:28:08Z")

</div>

Hi Lukas ,  
I have created a request

> <https://github.com/elastic/kibana/issues/16803>

Thanks and Regards,

---

<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: [March 18, 2018, 8:28pm UTC](https://discuss.elastic.co/t/scripted-field-with-timezone/120270/4 "2018-03-18T20:28:20Z")

</div>

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