# Date query (problem with format)

**URL:** <https://discuss.elastic.co/t/date-query-problem-with-format/234884>\
**Category:** Elasticsearch\
**Created:** [May 29, 2020, 8:32am UTC](https://discuss.elastic.co/t/date-query-problem-with-format/234884 "2020-05-29T08:32:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mimimike](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mimimike/32/60397_2.png) [@mimimike](https://discuss.elastic.co/u/mimimike)\
**Post date:** [May 29, 2020, 8:32am UTC](https://discuss.elastic.co/t/date-query-problem-with-format/234884/1 "2020-05-29T08:32:00Z")

</div>

Hi,

I have an index with a date field with dd/mm/yyyy format and I would like to search the documents of a specific day but maybe the format could not be the same as the index. How can I pass the format for parse the date?

Thanks

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [May 29, 2020, 9:14am UTC](https://discuss.elastic.co/t/date-query-problem-with-format/234884/2 "2020-05-29T09:14:09Z")

</div>

That's a problem to solve at index time as you want to have a field which mapping is `date` not `text`.

Then it's not anymore a problem at query time.

---

<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:** [June 26, 2020, 9:14am UTC](https://discuss.elastic.co/t/date-query-problem-with-format/234884/3 "2020-06-26T09:14:12Z")

</div>

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