# Change timestamp format

**URL:** <https://discuss.elastic.co/t/change-timestamp-format/179756>\
**Category:** Logstash\
**Created:** [May 6, 2019, 11:33am UTC](https://discuss.elastic.co/t/change-timestamp-format/179756 "2019-05-06T11:33:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![chaire](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chaire/32/38866_2.png) [@chaire](https://discuss.elastic.co/u/chaire)\
**Post date:** [May 6, 2019, 11:33am UTC](https://discuss.elastic.co/t/change-timestamp-format/179756/1 "2019-05-06T11:33:40Z")

</div>

Hi. I've searched the forum for similar problems but I found no solution.

I want to change my timestamp format from "MMM/dd/yyyy HH:mm:ss Z" to "yyyy-MM-dd HH:mm:ss". How do I do it in Logstash? I need this because I'm comparing this field with another timestamp field from database input through jdbc\_static filter (I use the timestamp as parameter in jdbc lookup).

Thank you for the help.

---

<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:** [May 6, 2019, 12:54pm UTC](https://discuss.elastic.co/t/change-timestamp-format/179756/2 "2019-05-06T12:54:01Z")

</div>

If you need to specify the format of a datetime then use a ruby filter and strftime.

---

<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:** [June 3, 2019, 12:54pm UTC](https://discuss.elastic.co/t/change-timestamp-format/179756/3 "2019-06-03T12:54:03Z")

</div>

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