# Timezone and logstash

**URL:** <https://discuss.elastic.co/t/timezone-and-logstash/25051>\
**Category:** Logstash\
**Created:** [July 7, 2015, 2:36pm UTC](https://discuss.elastic.co/t/timezone-and-logstash/25051 "2015-07-07T14:36:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![hellqvio](https://avatars.discourse-cdn.com/v4/letter/h/8491ac/32.png) [@hellqvio](https://discuss.elastic.co/u/hellqvio)\
**Post date:** [July 7, 2015, 2:36pm UTC](https://discuss.elastic.co/t/timezone-and-logstash/25051/1 "2015-07-07T14:36:13Z")

</div>

Hi.  
I had a hack that worked fine until I upgraded to logstash 1.5.1 that converted UTC time to CEST.

The hack that no longer works (since localtime doesn't exist) was to convert the timestamp to my servers timezone (CEST):  
ruby {  
code =\> "event['@timestamp'] = event['@timestamp'].localtime((((Time.now).to\_s).split(' ')[-1]).insert(3, ':'))"  
}

The timestamp is in following format: 2015-07-07T15:11:08.393040+02:00

And I use the following joda pattern to parse it:  
date {  
#2015-07-07T15:11:08.393040+02:00  
match =\> ["timestampfield", "YYYY-MM-dd'T'HH:mm:ss.SSSSSSZZ"]  
timezone =\> "Europe/Stockholm"  
}

I want the timestamp in CEST since everything else in the elasticsearch cluster is in CEST, this type is now in UTC:  
"@timestamp" =\> "2015-07-07T13:11:08.393Z"

What's the way to do this?

---

<div class="post-metadata">

**Author:** ![z\_w\_w1981](https://avatars.discourse-cdn.com/v4/letter/z/41988e/32.png) [@z\_w\_w1981](https://discuss.elastic.co/u/z_w_w1981)\
**Post date:** [September 1, 2015, 5:01am UTC](https://discuss.elastic.co/t/timezone-and-logstash/25051/2 "2015-09-01T05:01:26Z")

</div>

I also encounter the same problem.

---

<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 6, 2017, 5:30am UTC](https://discuss.elastic.co/t/timezone-and-logstash/25051/3 "2017-07-06T05:30:34Z")

</div>


