# Datehistogram on DayLightSaving time range produces wrong buckets

**URL:** <https://discuss.elastic.co/t/datehistogram-on-daylightsaving-time-range-produces-wrong-buckets/355902>\
**Category:** Elasticsearch\
**Tags:** aggregations\
**Created:** [March 21, 2024, 1:02pm UTC](https://discuss.elastic.co/t/datehistogram-on-daylightsaving-time-range-produces-wrong-buckets/355902 "2024-03-21T13:02:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vishnu\_R](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vishnu_r/32/132853_2.png) [@Vishnu\_R](https://discuss.elastic.co/u/Vishnu_R)\
**Post date:** [March 21, 2024, 1:02pm UTC](https://discuss.elastic.co/t/datehistogram-on-daylightsaving-time-range-produces-wrong-buckets/355902/1 "2024-03-21T13:02:19Z")

</div>

Time Zone: America/Los\_Angeles  
Search Start Time - 10/03/2024 00:00  
Search End Time - 10/03/2024 04:00  
Note - On DST clock forwards one hour, after 10/03/2024 1:59 we will have 10/03/2024 3:00.  
Date histogram interval: 41(minutes)

[Shared the needed data to reproduce the issue.](https://github.com/Vishnu0727/ES-Date-Histo-Query/blob/main/README.md)

Search Query,

```auto
curl -X POST "localhost:9200/test/_search?size=0&pretty" -H 'Content-Type: application/json' -d'
    {
	  "explain": false,
	  "size": 0,
	  "query": {
	    "bool": {
	      "adjust_pure_negative": true,
	      "must": [
		{
		  "range": {
		    "messagetime": {
		      "include_lower": true,
		      "include_upper": true,
		      "from": 1710061200000,
		      "to": 1710068400000
		    }
		  }
		}
	      ]
	    }
	  },
	  "from": 0,
	  "aggregations": {
	    "timeslice|timehisto": {
	      "date_histogram": {
		"field": "messagetime",
		"offset": 660000,
		"fixed_interval": "43m",
		"time_zone": "America/Los_Angeles",
		"keyed": false,
		"min_doc_count": 0,
		"order": {
		  "_key": "asc"
		},
		"extended_bounds": {
		  "min": 1710061200000,
		  "max": 1710068400000
		}
	      }
	    }
	  },
	  "track_total_hits": true
    }'
    

```

Actual Problem

 ![Search Result](https://us1.discourse-cdn.com/elastic/original/3X/0/d/0de45eff95699f59eaf35730e8a162c015666a25.png)

---

<div class="post-metadata">

**Author:** ![Vishnu\_R](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vishnu_r/32/132853_2.png) [@Vishnu\_R](https://discuss.elastic.co/u/Vishnu_R)\
**Post date:** [April 16, 2024, 8:49am UTC](https://discuss.elastic.co/t/datehistogram-on-daylightsaving-time-range-produces-wrong-buckets/355902/2 "2024-04-16T08:49:28Z")

</div>

Date histogram interval : **43 minutes** (typing mistake before it was 41 minutes)  
Sorry for the inconvenience

---

<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 14, 2024, 8:50am UTC](https://discuss.elastic.co/t/datehistogram-on-daylightsaving-time-range-produces-wrong-buckets/355902/3 "2024-05-14T08:50:15Z")

</div>

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