# For the same data with date format search works in Elasticsearch 6.x.But, it do not work on 7.x

**URL:** <https://discuss.elastic.co/t/for-the-same-data-with-date-format-search-works-in-elasticsearch-6-x-but-it-do-not-work-on-7-x/265536>\
**Category:** Elasticsearch\
**Created:** [February 25, 2021, 8:12pm UTC](https://discuss.elastic.co/t/for-the-same-data-with-date-format-search-works-in-elasticsearch-6-x-but-it-do-not-work-on-7-x/265536 "2021-02-25T20:12:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bharath\_Italapur](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bharath_italapur/32/51588_2.png) [@Bharath\_Italapur](https://discuss.elastic.co/u/Bharath_Italapur)\
**Post date:** [February 25, 2021, 8:12pm UTC](https://discuss.elastic.co/t/for-the-same-data-with-date-format-search-works-in-elasticsearch-6-x-but-it-do-not-work-on-7-x/265536/1 "2021-02-25T20:12:53Z")

</div>

Hi,

The search with timestamp is not working for the 12-hour date format on 7.X . Please help me understand or fix the issue posted below. Thank you for the help.

------- This is the date format we are using.

PUT test  
{  
"mappings" : {  
"properties" : {  
"ADDTSX" : {  
"type" : "date",  
"format" : "MM/dd/yyyy hh:mm:ss.SSSSSS a XXX"  
},  
"ADDTSZ" : {  
"type" : "date",  
"format" : "MM/dd/yyyy hh:mm:ss.SSSSSS a ZZZZZ"  
}  
}  
}  
}

We were able to ingest data into elasticsearch.

PUT test/\_doc/1  
{  
"ADDTSX": "04/01/2019 10:44:29.364443 AM -04:00",  
"ADDTSZ": "04/01/2019 10:44:29.364443 AM -04:00"  
}

----- When I do a search using term or match for timestamp using below query

GET test/\_search  
{  
"query": {  
"term": {  
"ADDTSX": {  
"value": "04/01/2019 10:44:29.364443 AM -04:00"  
}  
}  
}  
}  
GET test/\_search  
{  
"query": {  
"match": {  
"ADDTSX": "04/01/2019 10:44:29.364443 AM -04:00"  
}  
}  
}

------- I am seeing the error below.

{  
"error" : {  
"root\_cause" : [  
{  
"type" : "parse\_exception",  
"reason" : "failed to parse date field [04/01/2019 10:44:29.364443 AM -04:00] with format [MM/dd/yyyy hh:mm:ss.SSSSSS a XXX]: [failed to parse date field [04/01/2019 10:44:29.364443 AM -04:00] with format [MM/dd/yyyy hh:mm:ss.SSSSSS a XXX]]"  
}  
],  
"type" : "search\_phase\_execution\_exception",  
"reason" : "all shards failed",  
"phase" : "query",  
"grouped" : true,  
"failed\_shards" : [  
{  
"shard" : 0,  
"index" : "om\_temp",  
"node" : "bFZ2beNLSt25xckNC7vb2Q",  
"reason" : {  
"type" : "query\_shard\_exception",  
"reason" : "failed to create query: failed to parse date field [04/01/2019 10:44:29.364443 AM -04:00] with format [MM/dd/yyyy hh:mm:ss.SSSSSS a XXX]: [failed to parse date field [04/01/2019 10:44:29.364443 AM -04:00] with format [MM/dd/yyyy hh:mm:ss.SSSSSS a XXX]]",  
"index\_uuid" : "Ebrd7LKcTceOsZt\_qCEK7Q",  
"index" : "om\_temp",  
"caused\_by" : {  
"type" : "parse\_exception",  
"reason" : "failed to parse date field [04/01/2019 10:44:29.364443 AM -04:00] with format [MM/dd/yyyy hh:mm:ss.SSSSSS a XXX]: [failed to parse date field [04/01/2019 10:44:29.364443 AM -04:00] with format [MM/dd/yyyy hh:mm:ss.SSSSSS a XXX]]",  
"caused\_by" : {  
"type" : "illegal\_argument\_exception",  
"reason" : "failed to parse date field [04/01/2019 10:44:29.364443 AM -04:00] with format [MM/dd/yyyy hh:mm:ss.SSSSSS a XXX]",  
"caused\_by" : {  
"type" : "date\_time\_parse\_exception",  
"reason" : "date\_time\_parse\_exception: Text '04/01/2019 10:44:29.364443 AM -04:00' could not be parsed: Conflict found: HourOfDay 23 differs from HourOfDay 10 while resolving AmPmOfDay",  
"caused\_by" : {  
"type" : "date\_time\_exception",  
"reason" : "date\_time\_exception: Conflict found: HourOfDay 23 differs from HourOfDay 10 while resolving AmPmOfDay"  
}  
}  
}  
}  
}  
}  
],

---

<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 25, 2021, 8:13pm UTC](https://discuss.elastic.co/t/for-the-same-data-with-date-format-search-works-in-elasticsearch-6-x-but-it-do-not-work-on-7-x/265536/2 "2021-03-25T20:13:35Z")

</div>

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