# Logstash datetime filter if else

**URL:** <https://discuss.elastic.co/t/logstash-datetime-filter-if-else/254430>\
**Category:** Logstash\
**Created:** [November 5, 2020, 2:58pm UTC](https://discuss.elastic.co/t/logstash-datetime-filter-if-else/254430 "2020-11-05T14:58:12Z")\
**Posts on this page:** 1\
**Showing post:** 4

<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:** [November 5, 2020, 5:28pm UTC](https://discuss.elastic.co/t/logstash-datetime-filter-if-else/254430/4 "2020-11-05T17:28:31Z")

</div>

> [@tamilarasanbravo](#):
>
> 2020-11-05T16:21:17.094Z

A date filter converts the field to a LogStash::Timestamp, and what you have there is the string representation of such an object. If your fields are type date in elasticsearch then they are stored as milliseconds since the UNIX epoch in UTC.

If you want the field stored as a string in a particular format then use [strftime](https://discuss.elastic.co/t/date-field-being-converted-to-timestamps/180044/4).

---

_[View the full topic](https://discuss.elastic.co/t/logstash-datetime-filter-if-else/254430)._
