# Using a different date range format than what is defined on Elasticsearch cluster

**URL:** <https://discuss.elastic.co/t/using-a-different-date-range-format-than-what-is-defined-on-elasticsearch-cluster/116905>\
**Category:** Elasticsearch\
**Created:** [January 24, 2018, 5:22pm UTC](https://discuss.elastic.co/t/using-a-different-date-range-format-than-what-is-defined-on-elasticsearch-cluster/116905 "2018-01-24T17:22:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![elasticdude](https://avatars.discourse-cdn.com/v4/letter/e/aca169/32.png) [@elasticdude](https://discuss.elastic.co/u/elasticdude)\
**Post date:** [January 24, 2018, 5:22pm UTC](https://discuss.elastic.co/t/using-a-different-date-range-format-than-what-is-defined-on-elasticsearch-cluster/116905/1 "2018-01-24T17:22:30Z")

</div>

I came across the [post](https://discuss.elastic.co/t/query-much-faster-against-timestamp-in-seconds-than-milliseconds/58767) in which it is mentioned that reducing the time range matching to seconds precision would result in improvement in query latency.

In my table date format is "yyyy-mm-dd hh:mm:ss.NNN". When I'm trying to run a query like below, its failing with error which I guess is expected.

```
"range": {
     "timestamp": {
         "gte": "2017-12-22 00:00:00",
         "lte": "2018-01-22 23:59:59"
     }
}

```

Is there anyway I can run queries which will only match till seconds place ignoring the milliseconds?

Also, I was thinking restricting the query to indices would result in improvement in latency but queries took same time as simple time range match. Is this expected behavior?

---

<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:** [February 21, 2018, 5:22pm UTC](https://discuss.elastic.co/t/using-a-different-date-range-format-than-what-is-defined-on-elasticsearch-cluster/116905/2 "2018-02-21T17:22:56Z")

</div>

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