# Date Custom Field Timezone

**URL:** https://discuss.elastic.co/t/date-custom-field-timezone/108673
**Category:** Logstash
**Created:** [November 22, 2017, 8:52am UTC](https://discuss.elastic.co/t/date-custom-field-timezone/108673 "2017-11-22T08:52:12Z")
**Posts on this page:** 1
**Showing post:** 6

<div class="post-metadata">

### Author: ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)
#### Post date: [November 22, 2017, 2:11pm UTC](https://discuss.elastic.co/t/date-custom-field-timezone/108673/6 "2017-11-22T14:11:56Z")

</div>

You need to convert the timestamp to the local timezone. I don't know OTOH how to do that. Perhaps

```nohighlight
t = event.get('tempdate').time
t.localtime('+01:00')
event.set('logdatetime', t.strftime('%Y-%m-%dT%H:%M:%S +0100'))

```

works.

---

_[View the full topic](https://discuss.elastic.co/t/date-custom-field-timezone/108673)._
