# Date format MM/dd/yyyy hh:MM:ss tt

**URL:** <https://discuss.elastic.co/t/date-format-mm-dd-yyyy-hh-mm-ss-tt/8400>\
**Category:** Elasticsearch\
**Created:** [July 12, 2012, 4:42pm UTC](https://discuss.elastic.co/t/date-format-mm-dd-yyyy-hh-mm-ss-tt/8400 "2012-07-12T16:42:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![coys](https://avatars.discourse-cdn.com/v4/letter/c/eb8c5e/32.png) [@coys](https://discuss.elastic.co/u/coys)\
**Post date:** [July 12, 2012, 4:42pm UTC](https://discuss.elastic.co/t/date-format-mm-dd-yyyy-hh-mm-ss-tt/8400/1 "2012-07-12T16:42:00Z")

</div>

Hello, I have a date in the following format 7/12/2012 1:06:47 AM. Can  
I still map it in elasticsearch? If yes what should i specify the  
format as?  
I earlier had a date in MM/dd/yy format and I was able to map it using  
{"type":"date", "format":"MM/dd/yyyy" } and my range queries work but  
when I try to do the same now using {"type":"date", "format":"MM/dd/  
yyyy hh:MM:ss tt" } elasticsearch does not let me. Thanks.

---

<div class="post-metadata">

**Author:** ![Igor\_Motov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/igor_motov/32/45193_2.png) [@Igor\_Motov](https://discuss.elastic.co/u/Igor_Motov)\
**Post date:** [July 12, 2012, 5:42pm UTC](https://discuss.elastic.co/t/date-format-mm-dd-yyyy-hh-mm-ss-tt/8400/2 "2012-07-12T17:42:01Z")

</div>

I think you meant this: "MM/dd/yyyy hh:mm:ss a"

On Thursday, July 12, 2012 12:42:00 PM UTC-4, coys wrote:

> Hello, I have a date in the following format 7/12/2012 1:06:47 AM. Can  
> I still map it in elasticsearch? If yes what should i specify the  
> format as?  
> I earlier had a date in MM/dd/yy format and I was able to map it using  
> {"type":"date", "format":"MM/dd/yyyy" } and my range queries work but  
> when I try to do the same now using {"type":"date", "format":"MM/dd/  
> yyyy hh:MM:ss tt" } elasticsearch does not let me. Thanks.

---

<div class="post-metadata">

**Author:** ![coys](https://avatars.discourse-cdn.com/v4/letter/c/eb8c5e/32.png) [@coys](https://discuss.elastic.co/u/coys)\
**Post date:** [July 12, 2012, 6:35pm UTC](https://discuss.elastic.co/t/date-format-mm-dd-yyyy-hh-mm-ss-tt/8400/3 "2012-07-12T18:35:01Z")

</div>

Thanks a lot again Igor! 🙂

---

<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, 3:20am UTC](https://discuss.elastic.co/t/date-format-mm-dd-yyyy-hh-mm-ss-tt/8400/4 "2017-07-06T03:20:27Z")

</div>


