# Time range rounding down to multiple minutes. Is it possible somehow?

**URL:** <https://discuss.elastic.co/t/time-range-rounding-down-to-multiple-minutes-is-it-possible-somehow/199455>\
**Category:** Elasticsearch\
**Created:** [September 13, 2019, 3:20pm UTC](https://discuss.elastic.co/t/time-range-rounding-down-to-multiple-minutes-is-it-possible-somehow/199455 "2019-09-13T15:20:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![crickes](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/crickes/32/18009_2.png) [@crickes](https://discuss.elastic.co/u/crickes)\
**Post date:** [September 13, 2019, 3:20pm UTC](https://discuss.elastic.co/t/time-range-rounding-down-to-multiple-minutes-is-it-possible-somehow/199455/1 "2019-09-13T15:20:03Z")

</div>

I am using a range query on a timestamp in order to select some documents:

```
        {
          "range": {
            "start_time_UTC": {
              "gte": "now-5m/m",
              "lt": "now"
            }
          }
        },

```

In this example, if the time now is 16:13:45, it will take 5 minutes away (16:08:45), and then round down to the nearest minute (16:08:00). What I want to be able to do is select documents from the start of the last 5 minute period (from 16:05:00), so something like "gte": "now-5m/5m", but we're not allowed to use multiples of a period in the rounding down in this way. Is there another way to achieve this?

---

<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 11, 2019, 3:20pm UTC](https://discuss.elastic.co/t/time-range-rounding-down-to-multiple-minutes-is-it-possible-somehow/199455/2 "2019-10-11T15:20:03Z")

</div>

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