# Creating a new date field by splitting an existing timestamp in Kibana 5.0.0

**URL:** <https://discuss.elastic.co/t/creating-a-new-date-field-by-splitting-an-existing-timestamp-in-kibana-5-0-0/64275>\
**Category:** Kibana\
**Created:** [October 28, 2016, 12:03pm UTC](https://discuss.elastic.co/t/creating-a-new-date-field-by-splitting-an-existing-timestamp-in-kibana-5-0-0/64275 "2016-10-28T12:03:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kulasangar\_Gowrisang](https://avatars.discourse-cdn.com/v4/letter/k/ce73a5/32.png) [@Kulasangar\_Gowrisang](https://discuss.elastic.co/u/Kulasangar_Gowrisang)\
**Post date:** [October 28, 2016, 12:03pm UTC](https://discuss.elastic.co/t/creating-a-new-date-field-by-splitting-an-existing-timestamp-in-kibana-5-0-0/64275/1 "2016-10-28T12:03:55Z")

</div>

I already have an index which contains data from a MySQL database and I wanted use `Histogram` aggregation Kibana so that I can show a `vertical bar chart` or a `data table` for every single day.

The problem I'm having is that, I don't particularly have, a day or a month or an year field in my db separately. What I have is a `timestamp` field in my table, like as follows:

![](https://us1.discourse-cdn.com/elastic/original/2X/c/c134708575268b247fcfc8e828d57328e5e81a22.png)

How can i create a scripted field or is there any other way in `Kibana` to get only the day, month and the year from the `timestamp` so that I can include it in the `histogram`.

Any help could be appreciated.

---

<div class="post-metadata">

**Author:** ![cjcenizal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cjcenizal/32/11216_2.png) [@cjcenizal](https://discuss.elastic.co/u/cjcenizal)\
**Post date:** [October 28, 2016, 10:03pm UTC](https://discuss.elastic.co/t/creating-a-new-date-field-by-splitting-an-existing-timestamp-in-kibana-5-0-0/64275/2 "2016-10-28T22:03:11Z")

</div>

Hi Kulasangar,

Nice to hear from you again! I think you want to adjust your Elasticsearch mapping to format the field as a Date: [https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-date-format.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-date-format.html). Please let me know if this helps!

Thanks,  
CJ

---

<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 6, 2017, 1:35pm UTC](https://discuss.elastic.co/t/creating-a-new-date-field-by-splitting-an-existing-timestamp-in-kibana-5-0-0/64275/3 "2017-07-06T13:35:13Z")

</div>


