# Date Long Overflow 7.9

**URL:** <https://discuss.elastic.co/t/date-long-overflow-7-9/248488>\
**Category:** Elasticsearch\
**Created:** [September 14, 2020, 8:30am UTC](https://discuss.elastic.co/t/date-long-overflow-7-9/248488 "2020-09-14T08:30:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Escalus](https://avatars.discourse-cdn.com/v4/letter/e/898d66/32.png) [@Escalus](https://discuss.elastic.co/u/Escalus)\
**Post date:** [September 14, 2020, 8:30am UTC](https://discuss.elastic.co/t/date-long-overflow-7-9/248488/1 "2020-09-14T08:30:59Z")

</div>

Hello,  
I get a long overflow in my date fields if the time is pior to 1970.  
The epoch\_time is a negativ long value and throws an arithmetic\_exception on reindex

```
{
  "index" : "xxx",
  "type" : "_doc",
  "id" : "pub.1081024675",
  "cause" : {
    "type" : "mapper_parsing_exception",
    "reason" : "failed to parse field [date] of type [date] in document with id 'pub.1081024675'. Preview of field's value: '-950400000'",
    "caused_by" : {
      "type" : "arithmetic_exception",
      "reason" : "long overflow"
     }
   },
   "status" : 400
}

```

There was no problem with elastic 7.4.2.

---

<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:** [September 17, 2020, 1:25pm UTC](https://discuss.elastic.co/t/date-long-overflow-7-9/248488/2 "2020-09-17T13:25:19Z")

</div>

can you share the mapping and a sample document?

---

<div class="post-metadata">

**Author:** ![Escalus](https://avatars.discourse-cdn.com/v4/letter/e/898d66/32.png) [@Escalus](https://discuss.elastic.co/u/Escalus)\
**Post date:** [September 18, 2020, 9:00am UTC](https://discuss.elastic.co/t/date-long-overflow-7-9/248488/3 "2020-09-18T09:00:18Z")

</div>

My mapping was something like this:

```
"date": {
    "type": "date",
    "ignore_malformed" : true,
}

```

I found this [discussion](https://github.com/elastic/elasticsearch/issues/52396) on the Git project and changed the default format to "epoch\_millis" only

```
"date" : {
    "type" : "date",
    "ignore_malformed" : true,
    "format" : "epoch_millis"
}

```

This solved the problem in the short term. I think in the long term I must change our code to use datestrings instead of epoch\_millis. I realy hate date formats and all this conversions ^^.

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:** [October 16, 2020, 9:00am UTC](https://discuss.elastic.co/t/date-long-overflow-7-9/248488/4 "2020-10-16T09:00:26Z")

</div>

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