# How to convert a timestamp field to add a new field like "YYYY-MM-dd"

**URL:** https://discuss.elastic.co/t/how-to-convert-a-timestamp-field-to-add-a-new-field-like-yyyy-mm-dd/51893
**Category:** Logstash
**Created:** [June 6, 2016, 4:35am UTC](https://discuss.elastic.co/t/how-to-convert-a-timestamp-field-to-add-a-new-field-like-yyyy-mm-dd/51893 "2016-06-06T04:35:21Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![changxy](https://avatars.discourse-cdn.com/v4/letter/c/2acd7d/32.png) [@changxy](https://discuss.elastic.co/u/changxy)
#### Post date: [June 6, 2016, 4:35am UTC](https://discuss.elastic.co/t/how-to-convert-a-timestamp-field-to-add-a-new-field-like-yyyy-mm-dd/51893/1 "2016-06-06T04:35:22Z")

</div>

i need add a new field from a date filed  
this date filed value is : 1465071797

$ date -d @1465071797  
Sun Jun 5 04:23:17 CST 2016

the new field hope looks like "2016-06-05"

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [June 6, 2016, 4:40am UTC](https://discuss.elastic.co/t/how-to-convert-a-timestamp-field-to-add-a-new-field-like-yyyy-mm-dd/51893/2 "2016-06-06T04:40:13Z")

</div>

Use the date filter - [https://www.elastic.co/guide/en/logstash/current/plugins-filters-date.html#plugins-filters-date-match](https://www.elastic.co/guide/en/logstash/current/plugins-filters-date.html#plugins-filters-date-match)

---

<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: [July 6, 2017, 4:54am UTC](https://discuss.elastic.co/t/how-to-convert-a-timestamp-field-to-add-a-new-field-like-yyyy-mm-dd/51893/3 "2017-07-06T04:54:28Z")

</div>


