# Failing the date epoch\_second query

**URL:** <https://discuss.elastic.co/t/failing-the-date-epoch-second-query/253129>\
**Category:** Elastic Search\
**Created:** [October 23, 2020, 12:37pm UTC](https://discuss.elastic.co/t/failing-the-date-epoch-second-query/253129 "2020-10-23T12:37:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![chintushah46](https://avatars.discourse-cdn.com/v4/letter/c/977dab/32.png) [@chintushah46](https://discuss.elastic.co/u/chintushah46)\
**Post date:** [October 23, 2020, 12:37pm UTC](https://discuss.elastic.co/t/failing-the-date-epoch-second-query/253129/1 "2020-10-23T12:37:13Z")

</div>

Hi,

Mapping of the field,

```
"date": {
"type": "date",
"format": "epoch_second"
},

```

Query,  
`{"query": {"range": {"date": {"lt": 1602785608.0}}}}`

The same query was working fine with Elasticsearch v6.3, but as soon as I upgraded it with v7.8. It's failing. After doing some research for the breaking changes, I found [following](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/breaking-changes-7.0.html#_date_formats_behavioural_change),

```
The epoch_millis and epoch_second formatters no longer support scientific notation.

```

So, When I verified as below,  
`{"query": {"range": {"date": {"lt": 1602785608}}}}`  
It worked.

But the issue is with the NEST. Even though I am trying to send the epoch value as LONG, it converts in DOUBLE and generates "1602785608.0" as giving me the following error,  
`failed to parse date field [1.602785608E9] with format [epoch_second]`

So even though I am giving value as 1602785608 it Elasticsearch get the value as 1602785608.0 and giving me above error.

Let me know If I am not clear enough or need more details.

Any help would be appreciated!

--Thanks,

---

<div class="post-metadata">

**Author:** ![chintushah46](https://avatars.discourse-cdn.com/v4/letter/c/977dab/32.png) [@chintushah46](https://discuss.elastic.co/u/chintushah46)\
**Post date:** [November 1, 2020, 12:54pm UTC](https://discuss.elastic.co/t/failing-the-date-epoch-second-query/253129/2 "2020-11-01T12:54:27Z")

</div>

Nevermind, found the issue on our implementation, which converts the number into the double.

---

<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:** [November 4, 2022, 8:16am UTC](https://discuss.elastic.co/t/failing-the-date-epoch-second-query/253129/3 "2022-11-04T08:16:09Z")

</div>


