# Update Timezone

**URL:** https://discuss.elastic.co/t/update-timezone/206475
**Category:** Logstash
**Created:** [November 4, 2019, 8:20pm UTC](https://discuss.elastic.co/t/update-timezone/206475 "2019-11-04T20:20:52Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Jim\_Thunder](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jim_thunder/32/45439_2.png) [@Jim\_Thunder](https://discuss.elastic.co/u/Jim_Thunder)
#### Post date: [November 4, 2019, 8:20pm UTC](https://discuss.elastic.co/t/update-timezone/206475/1 "2019-11-04T20:20:52Z")

</div>

Hello!

I have a `@timestamp` field that is created from two other fields. That works fine.

Kibana also updates the timezone automatically (from what I read). That also works fine.

I have a new field `HOUR` that has been created from the @timestamp field using strftime. That works fine as well.

Here's my issue: The `HOUR` field is using the UTC time. How can I change it to America/Chicago?

Here's my code:

```
ruby {
	code => "event.set('[DAY]',event.get('@timestamp').time.strftime('%a'))
	event.set('[DAY_OF_MONTH]',event.get('@timestamp').time.strftime('%d').to_i)
	event.set('[HOUR]',(event.get('@timestamp').time.strftime('%H').to_i))"
}
if [source] =~ "table" {
    mutate{ add_field => {
        "[@metadata][timestamp]" => "%{SMF30DTE} %{SMF30TME}"
    }}
    date{
		match => ["[@metadata][timestamp]", "yyyy-MM-dd HH:mm:ss:SS"]
		timezone => "America/Chicago"
		target => "@timestamp"
	}
}

```

Here's the output in Kibana:

```
Time DAY_OF_MONTH HOUR @timestamp   
13:58:23.430 4 20 November 4th 2019, 13:58:23.430

```

^^ The HOUR field should contain 13, not 20.

(I've gone through the documentation but it's really not that detailed, nor does it provide any examples.)

---

<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: [December 2, 2019, 8:21pm UTC](https://discuss.elastic.co/t/update-timezone/206475/2 "2019-12-02T20:21:03Z")

</div>

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