# Change time\_zone in date\_histogram composite aggregation does not work?

**URL:** <https://discuss.elastic.co/t/change-time-zone-in-date-histogram-composite-aggregation-does-not-work/208649>\
**Category:** Elasticsearch\
**Created:** [November 20, 2019, 8:19am UTC](https://discuss.elastic.co/t/change-time-zone-in-date-histogram-composite-aggregation-does-not-work/208649 "2019-11-20T08:19:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ian\_Sofiyan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ian_sofiyan/32/51092_2.png) [@Ian\_Sofiyan](https://discuss.elastic.co/u/Ian_Sofiyan)\
**Post date:** [November 20, 2019, 8:19am UTC](https://discuss.elastic.co/t/change-time-zone-in-date-histogram-composite-aggregation-does-not-work/208649/1 "2019-11-20T08:19:00Z")

</div>

here my mapping  
[mapping file](https://raw.githubusercontent.com/viyancs/elasticsearch/master/mapping.txt)  
then i try rerquest using like this  
[Request](https://raw.githubusercontent.com/viyancs/elasticsearch/master/request.txt)  
the result like this

* * *

```
> {
> "took": 1782,
> "timed_out": false,
> "_shards": {
> "total": 10,
> "successful": 10,
> "skipped": 0,
> "failed": 0
> },
> "hits": {
> "total": {
> "value": 10000,
> "relation": "gte"
> },
> "max_score": null,
> "hits": []
> },
> "aggregations": {
> "histograms2": {
> "buckets": [
> {
> "key_as_string": "2019-11-18",
> "key": 1574010000000,
> "doc_count": 1992566
> },
> {
> "key_as_string": "2019-11-19",
> "key": 1574096400000,
> "doc_count": 2440622
> }
> ]
> },
> "statistic": {
> "after_key": {
> "date_f": "2019-11-17",
> "country": "Australia",
> "region": "Australian Capital Territory",
> "city": "Canberra",
> "device_type": "Mobile",
> "device_brand": "Apple",
> "device_model": "iPhone",
> "os_name": "iOS",
> "browser_name": "Chrome"
> },
> "buckets": [
> {
> "key": {
> "date_f": "2019-11-17",
> "country": "",
> "region": "",
> "city": "",
> "device_type": "Desktop",
> "device_brand": "-",
> "device_model": "-",
> "os_name": "Linux",
> "browser_name": "Chrome"
> },
> "doc_count": 1,
> "sum_impressions": {
> "value": 1.0
> },
> "sum_requests": {
> "value": 1.0
> },
> "sum_clicks": {
> "value": 0.0
> }
> },
> {
> "key": {
> "date_f": "2019-11-17",
> "country": "",
> "region": "",
> "city": "",
> "device_type": "Desktop",
> "device_brand": "-",
> "device_model": "-",
> "os_name": "OS X",
> "browser_name": "Opera"
> },
> "doc_count": 5,
> "sum_impressions": {
> "value": 6.0
> },
> "sum_requests": {
> "value": 6.0
> },
> "sum_clicks": {
> "value": 0.0
> }
> },
> {
> "key": {
> "date_f": "2019-11-17",
> "country": "",
> "region": "",
> "city": "",
> "device_type": "Desktop",
> "device_brand": "-",
> "device_model": "-",
> "os_name": "Ubuntu",
> "browser_name": "Firefox"
> },
> "doc_count": 1,
> "sum_impressions": {
> "value": 1.0
> },
> "sum_requests": {
> "value": 1.0
> },
> "sum_clicks": {
> "value": 0.0
> }
> },
> {
> "key": {
> "date_f": "2019-11-17",
> "country": "",
> "region": "",
> "city": "",
> "device_type": "Desktop",
> "device_brand": "-",
> "device_model": "-",
> "os_name": "Windows",
> "browser_name": "Chrome"
> },
> "doc_count": 301,
> "sum_impressions": {
> "value": 701.0
> },
> "sum_requests": {
> "value": 701.0
> },
> "sum_clicks": {
> "value": 0.0
> }
> }

```

* * *

from that result date\_histogram outside composite have correct result the date formatted to time zone "Asia/Jakarta", but from result date\_histogram that inside composite didn't formatted , this is bug ?

---

<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:** [December 18, 2019, 8:19am UTC](https://discuss.elastic.co/t/change-time-zone-in-date-histogram-composite-aggregation-does-not-work/208649/2 "2019-12-18T08:19:08Z")

</div>

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