# Changing time zone format

**URL:** https://discuss.elastic.co/t/changing-time-zone-format/71775
**Category:** Logstash
**Created:** [January 16, 2017, 6:47pm UTC](https://discuss.elastic.co/t/changing-time-zone-format/71775 "2017-01-16T18:47:38Z")
**Posts on this page:** 1
**Showing post:** 17

<div class="post-metadata">

### Author: ![Dan](https://avatars.discourse-cdn.com/v4/letter/d/eada6e/32.png) [@Dan](https://discuss.elastic.co/u/Dan)
#### Post date: [January 20, 2017, 10:22am UTC](https://discuss.elastic.co/t/changing-time-zone-format/71775/17 "2017-01-20T10:22:39Z")

</div>

Getting below error

[2017-01-20T14:56:02,576][ERROR][logstash.filters.ruby] Ruby exception occurred: undefined method `localtime' for 2017-01-07T03:30:07.000Z:LogStash::Timestamp

doc and my system time zone both are same.

> [@Ruby exception occurred: undefined method \`localtime'](https://discuss.elastic.co/t/ruby-exception-occurred-undefined-method-localtime/48751):
>
> hi all, I am using logstash 2.1.3 ,I want to show the @timestamp field in my timezone, like "@timestamp" =\> "2015-03-09T04:24:29.718+08:00", I try to using ruby conversion in filter. filter { ruby { code =\> "event['@timestamp'] = event['@timestamp'].localtime('+08:00')" } } but i got the error msg as below, Ruby exception occurred: undefined method `localtime' for "2016-04-29T00:40:51.926Z":LogStash::Timestamp {:level=\>:error} Any help is welcome to resolve this.

---

_[View the full topic](https://discuss.elastic.co/t/changing-time-zone-format/71775)._
