# How to change date format when indexing

**URL:** <https://discuss.elastic.co/t/how-to-change-date-format-when-indexing/77847>\
**Category:** Logstash\
**Created:** [March 8, 2017, 4:19pm UTC](https://discuss.elastic.co/t/how-to-change-date-format-when-indexing/77847 "2017-03-08T16:19:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![varun1992](https://avatars.discourse-cdn.com/v4/letter/v/3da27b/32.png) [@varun1992](https://discuss.elastic.co/u/varun1992)\
**Post date:** [March 8, 2017, 4:19pm UTC](https://discuss.elastic.co/t/how-to-change-date-format-when-indexing/77847/1 "2017-03-08T16:19:27Z")

</div>

I have 2 date field in a CSV data, formatted as ==\> MM/dd/YY HH:mm

How can i change the format to ==\> YYYY/MM/dd HH:mm:ss  
when am indexing it using logstash ?

I want to save the field as date in elastic, not as a string or text. How can i do that ?

When i tried date match as below, field become string in elastic

date {  
match =\> ["Incident\_Close\_Date" , "MM/dd/YY HH:mm"]  
timezone =\> "Etc/UTC"  
}  
date {  
match =\> ["Incident\_Create\_Date" , "MM/dd/YY HH:mm"]  
timezone =\> "Etc/UTC"  
}

---

<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:** [April 5, 2017, 4:19pm UTC](https://discuss.elastic.co/t/how-to-change-date-format-when-indexing/77847/2 "2017-04-05T16:19:33Z")

</div>

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