# How to Query the data between 2 different timestamp

**URL:** <https://discuss.elastic.co/t/how-to-query-the-data-between-2-different-timestamp/276150>\
**Category:** Elasticsearch\
**Created:** [June 16, 2021, 1:37pm UTC](https://discuss.elastic.co/t/how-to-query-the-data-between-2-different-timestamp/276150 "2021-06-16T13:37:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kannan\_V](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kannan_v/32/87523_2.png) [@Kannan\_V](https://discuss.elastic.co/u/Kannan_V)\
**Post date:** [June 16, 2021, 1:37pm UTC](https://discuss.elastic.co/t/how-to-query-the-data-between-2-different-timestamp/276150/1 "2021-06-16T13:37:12Z")

</div>

Hi,  
How to query the data between 2 different timestamps?  
We have a data. I am able to query through Kibana Discover tab. But i am not able to query through devTools or Curl command.

Following is my devtool command

```auto
GET _all/_search
{  
  "query": {  
    "range": {
      "timestamp":{
        "boost": 1,
        "gt": "2021-06-14T00:00:00",
        "lt": "2021-06-15T00:00:00"
      }
    }
}
}

```

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [June 16, 2021, 4:14pm UTC](https://discuss.elastic.co/t/how-to-query-the-data-between-2-different-timestamp/276150/2 "2021-06-16T16:14:29Z")

</div>

Welcome!

The query looks good.  
Check that you don't have a typo, like `timestamp` vs `@timestamp`.  
Check that the data actually exists.  
Check if you have an issue with timezones. Remember that if you don't give the timezone, Elasticsearch will assume UTC time.

If finally it does not work, could you provide a full recreation script as described in [About the Elasticsearch category](https://discuss.elastic.co/t/about-the-elasticsearch-category/21). It will help to better understand what you are doing. Please, try to keep the example as simple as possible.

A full reproduction script is something anyone can **copy and paste in Kibana dev console** , click on the run button to reproduce your use case. It will help readers to understand, reproduce and if needed fix your problem. It will also most likely help to get a faster answer.

---

<div class="post-metadata">

**Author:** ![Kannan\_V](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kannan_v/32/87523_2.png) [@Kannan\_V](https://discuss.elastic.co/u/Kannan_V)\
**Post date:** [June 17, 2021, 11:40am UTC](https://discuss.elastic.co/t/how-to-query-the-data-between-2-different-timestamp/276150/3 "2021-06-17T11:40:49Z")

</div>

Thanks @dadoonet ... @timestamp is working for me.

---

<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:** [July 15, 2021, 11:41am UTC](https://discuss.elastic.co/t/how-to-query-the-data-between-2-different-timestamp/276150/4 "2021-07-15T11:41:41Z")

</div>

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