# Conversion of timeformat

**URL:** https://discuss.elastic.co/t/conversion-of-timeformat/270961
**Category:** Logstash
**Created:** [April 22, 2021, 1:01pm UTC](https://discuss.elastic.co/t/conversion-of-timeformat/270961 "2021-04-22T13:01:47Z")
**Posts on this page:** 1
**Showing post:** 6

<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: [April 29, 2021, 5:58pm UTC](https://discuss.elastic.co/t/conversion-of-timeformat/270961/6 "2021-04-29T17:58:53Z")

</div>

TIME and Time are different fields, as are date\_object and @date\_object. Joda does [not agree](https://discuss.elastic.co/t/replace-the-timestamp-with-actual-time-during-a-bulk-filebeat-send/269882/4) that that time format matches an ISO8601 pattern. Try

```
   date { match => ["Time", "yyyy-MM-dd HH:mm:ssZ"] target => "date_object" }
    ruby {
        code => '
            t = Time.at(event.get("date_object").to_f)
            event.set("Time1", t.strftime("%Y-%m-%d"))
        '
    }
```

---

_[View the full topic](https://discuss.elastic.co/t/conversion-of-timeformat/270961)._
