# Different values using date histogram

**URL:** https://discuss.elastic.co/t/different-values-using-date-histogram/326453
**Category:** Elasticsearch
**Created:** [February 24, 2023, 3:15pm UTC](https://discuss.elastic.co/t/different-values-using-date-histogram/326453 "2023-02-24T15:15:25Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![bcamboim](https://avatars.discourse-cdn.com/v4/letter/b/34f0e0/32.png) [@bcamboim](https://discuss.elastic.co/u/bcamboim)
#### Post date: [February 24, 2023, 3:15pm UTC](https://discuss.elastic.co/t/different-values-using-date-histogram/326453/1 "2023-02-24T15:15:26Z")

</div>

Hi everyone. I'am using the package @elastic/elasticsearch (^7.9.1) to do queries in my cluster.  
I have a dashboard showing the concurrent users using my videos platform. My query is:

```auto
{
    query: {
      bool: {
        must: [
          {
            match: {
              tenantId: tenantId
            }
          },
          {
            match: {
              type: 'watching'
            }
          },
          {
            range: {
              timestamp: {
                gte : initialDate,
                lte : endDate
              }
            }
          }
        ]
      }
    },
    size : 0,
    aggs : {
      range_aggs: {
        date_histogram: {
          field : 'timestamp',
          interval : 'minute',
          min_doc_count : 0,
          extended_bounds : {
            min : initialDate,
            max : endDate
          }
        }
      }
    }
  };

```

When I do a query range 6 hours ago or more, every result happens this (exactly 3 hours ago):

 ![concurrent-users](https://us1.discourse-cdn.com/elastic/original/3X/6/a/6adfdc067256c7e6752573c01587bc24c83fe0d6.png)

![3h](https://us1.discourse-cdn.com/elastic/original/3X/2/d/2dbcf469c0a4d40897f2b7eb8c27ff895fc68c76.png)

If I try the same request after 30 minutes, the drop in the graph will appear now + 30 minutes.

Has anyone ever experienced this? Can you help me?

Thanks!

---

<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: [March 24, 2023, 3:15pm UTC](https://discuss.elastic.co/t/different-values-using-date-histogram/326453/2 "2023-03-24T15:15:42Z")

</div>

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