# Type date\_range formatting v6.8 vs v7.12

**URL:** <https://discuss.elastic.co/t/type-date-range-formatting-v6-8-vs-v7-12/277698>\
**Category:** Elasticsearch\
**Created:** [July 3, 2021, 7:38am UTC](https://discuss.elastic.co/t/type-date-range-formatting-v6-8-vs-v7-12/277698 "2021-07-03T07:38:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![elasticfish](https://avatars.discourse-cdn.com/v4/letter/e/ee59a6/32.png) [@elasticfish](https://discuss.elastic.co/u/elasticfish)\
**Post date:** [July 3, 2021, 7:38am UTC](https://discuss.elastic.co/t/type-date-range-formatting-v6-8-vs-v7-12/277698/1 "2021-07-03T07:38:33Z")

</div>

Hello,  
I am upgrading from ES 6.8 to ES 7.12.1 and I have a dynamic template like:

```auto
"dynamic_templates": [
        {
          "ecom_data": {
            "mapping": {
              "type": "date_range",
              "format": "yyyy-MM-dd'T'HH:mm:ssZ"
            },
            "match_mapping_type": "object",
            "path_match": "ecom_data.*"
          }
        }
      ]

```

However when I try to index in ES 7.12.1 I get this error:

```auto
"type" : "mapper_parsing_exception",
          "reason" : "failed to parse field [ecom_data.free_value] of type [date_range] in document with id 'ecom:data:0NLAD0hvAUqKejb'. Preview of field's value: '2019-12-11T00:01:00Z'",
          "caused_by" : {
            "type" : "parse_exception",
            "reason" : "failed to parse date field [2019-12-11T00:01:00Z] with format ['yyyy-MM-ddTHH:mm:ssZ']: [failed to parse date field [2019-12-11T00:01:00Z] with format ['yyyy-MM-ddTHH:mm:ssZ']]",
            "caused_by" : {
              "type" : "illegal_argument_exception",
              "reason" : "failed to parse date field [2019-12-11T00:01:00Z] with format ['yyyy-MM-ddTHH:mm:ssZ']",
              "caused_by" : {
                "type" : "date_time_parse_exception",
                "reason" : "date_time_parse_exception: Text '2019-12-11T00:01:00Z' could not be parsed at index

```

I have tried different combinations of `"format": "yyyy-MM-dd'T'HH:mm:ssZ"` like `"format": "'yyyy-MM-ddTHH:mm:ssZ'"` but all fail. What has changed with data\_range between ES6 and ES7? 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:** [July 31, 2021, 7:38am UTC](https://discuss.elastic.co/t/type-date-range-formatting-v6-8-vs-v7-12/277698/2 "2021-07-31T07:38:42Z")

</div>

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