# Pulling date from Elastic and convert it to local time zone

**URL:** https://discuss.elastic.co/t/pulling-date-from-elastic-and-convert-it-to-local-time-zone/201345
**Category:** Logstash
**Created:** [September 27, 2019, 7:00am UTC](https://discuss.elastic.co/t/pulling-date-from-elastic-and-convert-it-to-local-time-zone/201345 "2019-09-27T07:00:51Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![saif3r](https://avatars.discourse-cdn.com/v4/letter/s/49beb7/32.png) [@saif3r](https://discuss.elastic.co/u/saif3r)
#### Post date: [September 27, 2019, 7:00am UTC](https://discuss.elastic.co/t/pulling-date-from-elastic-and-convert-it-to-local-time-zone/201345/1 "2019-09-27T07:00:51Z")

</div>

Hello,

I'm using Beats to to put data onto my Elasticsearch server. All machines incluing the monitored server are based in CET timezone. In Kibana i can see the @timestamp stored in CET, but when i pull it out using Logstash and put it into a flat file, it's stored in UTC. How can i make sure that the date i pull using Logstash is also stored as CET in flat file?  
Thanks.

---

<div class="post-metadata">

### Author: ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)
#### Post date: [September 27, 2019, 1:34pm UTC](https://discuss.elastic.co/t/pulling-date-from-elastic-and-convert-it-to-local-time-zone/201345/2 "2019-09-27T13:34:07Z")

</div>

logstash and elasticsearch always store dates in UTC. Kibana converts them to the timezone of the browser.

If you are using a date filter to parse strings you can lie about what timezone the strings are in to get a LogStash::Timezone object in a timezone other than UTC.

---

<div class="post-metadata">

### Author: ![saif3r](https://avatars.discourse-cdn.com/v4/letter/s/49beb7/32.png) [@saif3r](https://discuss.elastic.co/u/saif3r)
#### Post date: [October 1, 2019, 7:53am UTC](https://discuss.elastic.co/t/pulling-date-from-elastic-and-convert-it-to-local-time-zone/201345/3 "2019-10-01T07:53:11Z")

</div>

Thanks @Badger,  
So there's no easy way to convert it to a different timezone before outputting it into flat file?  
If that's true, could you hint me how exactly i can 'lie' to Logstash to make sure that my output flat file will have the dates stored in CET rather than UTC?  
Thanks!

---

<div class="post-metadata">

### Author: ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)
#### Post date: [October 1, 2019, 12:39pm UTC](https://discuss.elastic.co/t/pulling-date-from-elastic-and-convert-it-to-local-time-zone/201345/4 "2019-10-01T12:39:59Z")

</div>

If the timestamps in the log are UTC and you want to store them as (say) GMT+4, then tell the date filter they are GMT-4.

---

<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: [October 29, 2019, 12:40pm UTC](https://discuss.elastic.co/t/pulling-date-from-elastic-and-convert-it-to-local-time-zone/201345/5 "2019-10-29T12:40:03Z")

</div>

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