# Help understanding range query with date

**URL:** <https://discuss.elastic.co/t/help-understanding-range-query-with-date/227887>\
**Category:** Elasticsearch\
**Created:** [April 14, 2020, 10:35am UTC](https://discuss.elastic.co/t/help-understanding-range-query-with-date/227887 "2020-04-14T10:35:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mauog](https://avatars.discourse-cdn.com/v4/letter/m/a6a055/32.png) [@mauog](https://discuss.elastic.co/u/mauog)\
**Post date:** [April 14, 2020, 10:35am UTC](https://discuss.elastic.co/t/help-understanding-range-query-with-date/227887/1 "2020-04-14T10:35:36Z")

</div>

Hi all,  
I'm very new beginner with ELK stack.  
I'm trying to build a query that should get the documents created today.  
I thougt to write this query:

```
   "query": {
  "range": {
    "@timestamp": {
      "gte": "now/d",
      "lt": "now"
    }
 }
}

```

Unfortunately elasticsearch gives back documents with timestamps outside this range.  
What am I doing wrong?

Thank You

---

<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:** [May 12, 2020, 10:43am UTC](https://discuss.elastic.co/t/help-understanding-range-query-with-date/227887/2 "2020-05-12T10:43:21Z")

</div>

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