# Date Histogram - Date Format Change

**URL:** <https://discuss.elastic.co/t/date-histogram-date-format-change/296228>\
**Category:** Kibana\
**Created:** [February 3, 2022, 8:54pm UTC](https://discuss.elastic.co/t/date-histogram-date-format-change/296228 "2022-02-03T20:54:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Surya\_Raviraj](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/surya_raviraj/32/77606_2.png) [@Surya\_Raviraj](https://discuss.elastic.co/u/Surya_Raviraj)\
**Post date:** [February 3, 2022, 8:54pm UTC](https://discuss.elastic.co/t/date-histogram-date-format-change/296228/1 "2022-02-03T20:54:50Z")

</div>

I am currently using a date histogram for my visualization. Unfortunately, the date format seems to default to "yyyy-MM-dd". I would like to Modify it to "MMM-yyyy". I've applied that change on the field but I think while using date histogram it doesn't pick up that change. How can I accomplish this?

---

<div class="post-metadata">

**Author:** ![Tomo\_M](https://avatars.discourse-cdn.com/v4/letter/t/848f3c/32.png) [@Tomo\_M](https://discuss.elastic.co/u/Tomo_M)\
**Post date:** [February 4, 2022, 8:57am UTC](https://discuss.elastic.co/t/date-histogram-date-format-change/296228/2 "2022-02-04T08:57:35Z")

</div>

I tried Change Kigana \> Advanced Settings \> General \> Date format, but not worked in date histogram visualization.. And I couldn't find any settings in visualiations, sorry.

---

<div class="post-metadata">

**Author:** ![ghudgins](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ghudgins/32/138532_2.png) [@ghudgins](https://discuss.elastic.co/u/ghudgins)\
**Post date:** [February 9, 2022, 1:06am UTC](https://discuss.elastic.co/t/date-histogram-date-format-change/296228/3 "2022-02-09T01:06:00Z")

</div>

I would use a runtime field for this - we need to implement [https://github.com/elastic/kibana/issues/67206](https://github.com/elastic/kibana/issues/67206) before we have the native support.

as an example [runtime field](https://www.elastic.co/guide/en/kibana/7.17/managing-index-patterns.html#create-runtime-fields) you could do something like below but rather than `e` as your format you could select one from [this list](https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html)

```auto
ZonedDateTime input = doc['timestamp'].value;
String output = input.format(DateTimeFormatter.ofPattern('e')) ;

emit(output);

```

---

<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 9, 2022, 1:06am UTC](https://discuss.elastic.co/t/date-histogram-date-format-change/296228/4 "2022-03-09T01:06:36Z")

</div>

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