# Transforming fields to date type

**URL:** <https://discuss.elastic.co/t/transforming-fields-to-date-type/121493>\
**Category:** Elasticsearch\
**Created:** [February 26, 2018, 1:26pm UTC](https://discuss.elastic.co/t/transforming-fields-to-date-type/121493 "2018-02-26T13:26:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tomak](https://avatars.discourse-cdn.com/v4/letter/t/d9b06d/32.png) [@tomak](https://discuss.elastic.co/u/tomak)\
**Post date:** [February 26, 2018, 1:26pm UTC](https://discuss.elastic.co/t/transforming-fields-to-date-type/121493/1 "2018-02-26T13:26:26Z")

</div>

I have a database which I would like to add to Elasticsearch. In there, all documents have a field "date" however, it is not in a format that Elasticsearch considers as a date. It is of the form 01-2013 (for January 2013).

What is the best option. Should I modify my db and then add or would it be better to do it as I add my documents? (using the pipeline API if I understand things correctly

---

<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:** [March 26, 2018, 1:26pm UTC](https://discuss.elastic.co/t/transforming-fields-to-date-type/121493/2 "2018-03-26T13:26:47Z")

</div>

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