# Utc offset with timezone

**URL:** https://discuss.elastic.co/t/utc-offset-with-timezone/296881
**Category:** Kibana
**Created:** [February 10, 2022, 5:26pm UTC](https://discuss.elastic.co/t/utc-offset-with-timezone/296881 "2022-02-10T17:26:14Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![meyer1](https://avatars.discourse-cdn.com/v4/letter/m/b487fb/32.png) [@meyer1](https://discuss.elastic.co/u/meyer1)
#### Post date: [February 10, 2022, 5:26pm UTC](https://discuss.elastic.co/t/utc-offset-with-timezone/296881/1 "2022-02-10T17:26:14Z")

</div>

Hello everyone.

I have a timezone field in my data schema.

Example: timezone: "Los Angles"

Is it possible to create a scripted field and get the UTC offset from it?

Thanks in advance for your future responses.

---

<div class="post-metadata">

### Author: ![Marta\_Bondyra](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marta_bondyra/32/102122_2.png) [@Marta\_Bondyra](https://discuss.elastic.co/u/Marta_Bondyra)
#### Post date: [February 22, 2022, 9:56am UTC](https://discuss.elastic.co/t/utc-offset-with-timezone/296881/2 "2022-02-22T09:56:27Z")

</div>

By UTC offset you mean the difference of hours/minutes etc between your timezone and UTC? Unfortunately I don't think it's possible. You would have to make the changes in how you ingest your data (either ingesting utc\_time too, for example kibana\_sample\_data\_logs does that) or ingest directly a numeric `timezone` field.

---

<div class="post-metadata">

### Author: ![Tomo\_M](https://avatars.discourse-cdn.com/v4/letter/t/848f3c/32.png) [@Tomo\_M](https://discuss.elastic.co/u/Tomo_M)
#### Post date: [February 22, 2022, 4:22pm UTC](https://discuss.elastic.co/t/utc-offset-with-timezone/296881/3 "2022-02-22T16:22:46Z")

</div>

If there is a way, you may use [java.time.zone](https://www.elastic.co/guide/en/elasticsearch/painless/current/painless-datetime.html). There are some function to get offset from ZoneId.

"[Using Datetime in Painless](https://www.elastic.co/guide/en/elasticsearch/painless/current/painless-datetime.html)" would help you.

In addition, I wonder the timezone ID could be "America/Los\_Angeles" and I'm not sure you have to convert from "Los Angeles".

---

<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 22, 2022, 4:23pm UTC](https://discuss.elastic.co/t/utc-offset-with-timezone/296881/4 "2022-03-22T16:23:42Z")

</div>

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