# ElasticSearch 7.8 date and time format issue: unable to store date in MMM-dd-yyyy HH:mm:ss format . Was woking in 6.7.1

**URL:** <https://discuss.elastic.co/t/elasticsearch-7-8-date-and-time-format-issue-unable-to-store-date-in-mmm-dd-yyyy-hhss-format-was-woking-in-6-7-1/244450>\
**Category:** Elasticsearch\
**Created:** [August 10, 2020, 6:51pm UTC](https://discuss.elastic.co/t/elasticsearch-7-8-date-and-time-format-issue-unable-to-store-date-in-mmm-dd-yyyy-hhss-format-was-woking-in-6-7-1/244450 "2020-08-10T18:51:17Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![naresh\_sharma](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/naresh_sharma/32/73638_2.png) [@naresh\_sharma](https://discuss.elastic.co/u/naresh_sharma)\
**Post date:** [August 10, 2020, 6:51pm UTC](https://discuss.elastic.co/t/elasticsearch-7-8-date-and-time-format-issue-unable-to-store-date-in-mmm-dd-yyyy-hhss-format-was-woking-in-6-7-1/244450/1 "2020-08-10T18:51:17Z")

</div>

[2020-08-10T14:30:58,866][WARN][logstash.outputs.elasticsearch][main] Could not index event to Elasticsearch. {:status=\>400, :action=\>["index", {:\_id=\>nil, :\_index=\>"metrics", :routing=\>nil, :\_type=\>"\_doc"}, #LogStash::Event:0x37d9caae], :response=\>{"index"=\>{"\_index"=\>"metrics-20200803", "\_type"=\>"\_doc", "\_id"=\>"P5Sj2XMBruMyh45v0qce", "status"=\>400, "error"=\>{"type"=\>"mapper\_parsing\_exception", "reason"=\>"failed to parse field [metric\_date] of type [date] in document with id 'P5Sj2XMBruMyh45v0qce'. Preview of field's value: 'AUG-10-2020 04:00:00'", "caused\_by"=\>{"type"=\>"illegal\_argument\_exception", "reason"=\>"failed to parse date field [AUG-10-2020 04:00:00] with format [MMM-dd-yyyy||MMM-dd-yyyy HH:mm:ss]", "caused\_by"=\>{"type"=\>"date\_time\_parse\_exception", "reason"=\>"Failed to parse with all enclosed parsers"}}}}}}

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [August 10, 2020, 7:18pm UTC](https://discuss.elastic.co/t/elasticsearch-7-8-date-and-time-format-issue-unable-to-store-date-in-mmm-dd-yyyy-hhss-format-was-woking-in-6-7-1/244450/2 "2020-08-10T19:18:42Z")

</div>

That error message is from elasticsearch. You might get a better response if you move this to the elasticsearch forum.

---

<div class="post-metadata">

**Author:** ![naresh\_sharma](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/naresh_sharma/32/73638_2.png) [@naresh\_sharma](https://discuss.elastic.co/u/naresh_sharma)\
**Post date:** [August 10, 2020, 7:24pm UTC](https://discuss.elastic.co/t/elasticsearch-7-8-date-and-time-format-issue-unable-to-store-date-in-mmm-dd-yyyy-hhss-format-was-woking-in-6-7-1/244450/3 "2020-08-10T19:24:06Z")

</div>

Below is the index .  
PUT metrics-20200403  
{  
"settings": {  
"index": {  
"number\_of\_shards": "3",  
"number\_of\_replicas": "2"  
}  
},  
"mappings": {  
"doc": {  
"properties": {  
"metric\_date": { "type": "date", "format": "MMM-dd-yyyy||MMM-dd-yyyy HH:mm:ss" }  
}  
}  
}  
}

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [August 12, 2020, 9:41am UTC](https://discuss.elastic.co/t/elasticsearch-7-8-date-and-time-format-issue-unable-to-store-date-in-mmm-dd-yyyy-hhss-format-was-woking-in-6-7-1/244450/4 "2020-08-12T09:41:51Z")

</div>

While Elasticsearch \< 7 uses joda time for parsing, Elasticsearch \>= 7 uses java time. There are some subtle differences in parsing. In this examples, the month being all caps seems to be the problem. Trying this with `Aug` instead of `AUG` works for me.

Feel free to open a github issue explaining the different behaviour between ES 6 and 7.

Thanks!

---

<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:** [September 9, 2020, 9:42am UTC](https://discuss.elastic.co/t/elasticsearch-7-8-date-and-time-format-issue-unable-to-store-date-in-mmm-dd-yyyy-hhss-format-was-woking-in-6-7-1/244450/5 "2020-09-09T09:42:20Z")

</div>

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