# Date\_time format change in elasticsearch from version 6.5 to 7.2

**URL:** https://discuss.elastic.co/t/date-time-format-change-in-elasticsearch-from-version-6-5-to-7-2/188546
**Category:** Elasticsearch
**Created:** [July 2, 2019, 3:40pm UTC](https://discuss.elastic.co/t/date-time-format-change-in-elasticsearch-from-version-6-5-to-7-2/188546 "2019-07-02T15:40:39Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![tomassino](https://avatars.discourse-cdn.com/v4/letter/t/bcef8e/32.png) [@tomassino](https://discuss.elastic.co/u/tomassino)
#### Post date: [July 2, 2019, 3:40pm UTC](https://discuss.elastic.co/t/date-time-format-change-in-elasticsearch-from-version-6-5-to-7-2/188546/1 "2019-07-02T15:40:39Z")

</div>

Hi all, I noticed that some dates that were correctly handled by elasticsearch version 6.5 are rejected by elasticsearch 7.2. Here is an example:

**Elasticseach 7.2.0**

```
PUT localhost:9200/my_index
{
  "mappings": {
    "properties": {
      "date": {
        "type": "date",
        "format": "date_time"
      }
    }
  }
}

```

This document is successfully indexed:

```
POST localhost:9200/my_index/_doc
{
  "date": "99999-12-31T23:59:59.999+0000"
}

```

While this one is rejected:

```
POST localhost:9200/my_index/_doc
{
  "date": "100000-01-01T00:00:00.000+0000"
}

```

The error is:

```
{
  "error" : {
    "root_cause" : [
      {
        "type" : "mapper_parsing_exception",
        "reason" : "failed to parse field [date] of type [date] in document with id 'vp5Ms2sBNm1nVrvtzmYN'"
      }
    ],
    "type" : "mapper_parsing_exception",
    "reason" : "failed to parse field [date] of type [date] in document with id 'vp5Ms2sBNm1nVrvtzmYN'",
    "caused_by" : {
      "type" : "illegal_argument_exception",
      "reason" : "failed to parse date field [100000-01-01T00:00:00.000+0000] with format [date_time]",
      "caused_by" : {
        "type" : "date_time_parse_exception",
        "reason" : "Failed to parse with all enclosed parsers"
      }
    }
  },
  "status" : 400
}

```

**Elasticseach 6.5.4**

```
PUT localhost:9200/my_index
{
  "mappings": {
    "_doc": {
      "properties": {
        "date": {
          "type": "date",
          "format": "date_time"
        }
      }
    }
  }
}

```

Both documents are successfully indexed:

```
POST localhost:9200/my_index/_doc
{
  "date": "99999-12-31T23:59:59.999+0000"
}

POST localhost:9200/my_index/_doc
{
  "date": "100000-01-01T00:00:00.000+0000"
}

```

I haven't found anything in the changelogs about this, any suggestion on how to keep the old behavior?

---

<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: [July 3, 2019, 8:50am UTC](https://discuss.elastic.co/t/date-time-format-change-in-elasticsearch-from-version-6-5-to-7-2/188546/2 "2019-07-03T08:50:26Z")

</div>

This has very likely happened with the migration from joda time to java time. See [https://www.elastic.co/guide/en/elasticsearch/reference/7.2/breaking-changes-7.0.html#breaking\_70\_java\_time\_changes](https://www.elastic.co/guide/en/elasticsearch/reference/7.2/breaking-changes-7.0.html#breaking_70_java_time_changes)

Can you please open a github issue about this? Thank you!

--Alex

---

<div class="post-metadata">

### Author: ![tomassino](https://avatars.discourse-cdn.com/v4/letter/t/bcef8e/32.png) [@tomassino](https://discuss.elastic.co/u/tomassino)
#### Post date: [July 4, 2019, 9:35am UTC](https://discuss.elastic.co/t/date-time-format-change-in-elasticsearch-from-version-6-5-to-7-2/188546/3 "2019-07-04T09:35:56Z")

</div>

Thanks for your answer, I'll open the issue on github

---

<div class="post-metadata">

### Author: ![tomassino](https://avatars.discourse-cdn.com/v4/letter/t/bcef8e/32.png) [@tomassino](https://discuss.elastic.co/u/tomassino)
#### Post date: [July 4, 2019, 9:51am UTC](https://discuss.elastic.co/t/date-time-format-change-in-elasticsearch-from-version-6-5-to-7-2/188546/4 "2019-07-04T09:51:13Z")

</div>

Here is the GitHub issue: [https://github.com/elastic/elasticsearch/issues/43966](https://github.com/elastic/elasticsearch/issues/43966)

---

<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: [August 1, 2019, 9:51am UTC](https://discuss.elastic.co/t/date-time-format-change-in-elasticsearch-from-version-6-5-to-7-2/188546/5 "2019-08-01T09:51:16Z")

</div>

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