# What 24 horus starting from now and not round off

**URL:** <https://discuss.elastic.co/t/what-24-horus-starting-from-now-and-not-round-off/224262>\
**Category:** Elasticsearch\
**Created:** [March 19, 2020, 12:17pm UTC](https://discuss.elastic.co/t/what-24-horus-starting-from-now-and-not-round-off/224262 "2020-03-19T12:17:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Blason](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/blason/32/42284_2.png) [@Blason](https://discuss.elastic.co/u/Blason)\
**Post date:** [March 19, 2020, 12:17pm UTC](https://discuss.elastic.co/t/what-24-horus-starting-from-now-and-not-round-off/224262/1 "2020-03-19T12:17:31Z")

</div>

Hi team,

Can someone suggest; since I am using below with my search API, will it search the IP addresses starting from now - 24 hrs yesterday or will it take last 24 horus?

I need search IP addresses starting from now till - 24 hours. For example  
Starting from today 15.00 till yesterday 15.00

```auto
        {
          "range": {
            "@timestamp": {
              "gte": "now-1d/d",
              "lte": "now"

```

---

<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:** [March 19, 2020, 3:24pm UTC](https://discuss.elastic.co/t/what-24-horus-starting-from-now-and-not-round-off/224262/2 "2020-03-19T15:24:48Z")

</div>

If you want to figure out what this date actually got converted to, check out this example:

```auto
DELETE test

PUT test/_doc/1
{"@timestamp":"2020-03-19T10:10:10Z"}

PUT test/_doc/2
{"@timestamp":"2020-03-20T10:10:10Z"}

PUT test/_doc/3
{"@timestamp":"2020-02-20T10:10:10Z"}

GET test/_mapping

GET test/_search
{
  "query": {
    "range": {
      "@timestamp": {
        "gte": "now-1d"
      }
    }
  }
}

GET test/_validate/query?rewrite=true
{
  "query": {
    "range": {
      "@timestamp": {
        "gte": "now-1d"
      }
    }
  }
}

```

That should help you to understand the rounding logic and play around with it.

---

<div class="post-metadata">

**Author:** ![Blason](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/blason/32/42284_2.png) [@Blason](https://discuss.elastic.co/u/Blason)\
**Post date:** [March 20, 2020, 10:43am UTC](https://discuss.elastic.co/t/what-24-horus-starting-from-now-and-not-round-off/224262/3 "2020-03-20T10:43:56Z")

</div>

I am sorry but I really did not get it. Well my query was pretty simple how and what should be used to Search API so that I can fetch the result starting from now till minus 24 hours.

---

<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:** [April 17, 2020, 10:44am UTC](https://discuss.elastic.co/t/what-24-horus-starting-from-now-and-not-round-off/224262/4 "2020-04-17T10:44:10Z")

</div>

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