# Convert millisecond epoch time to ISO human readable time

**URL:** https://discuss.elastic.co/t/convert-millisecond-epoch-time-to-iso-human-readable-time/114178
**Category:** Kibana
**Created:** [January 4, 2018, 9:52pm UTC](https://discuss.elastic.co/t/convert-millisecond-epoch-time-to-iso-human-readable-time/114178 "2018-01-04T21:52:52Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![jeremymclain](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jeremymclain/32/26254_2.png) [@jeremymclain](https://discuss.elastic.co/u/jeremymclain)
#### Post date: [January 4, 2018, 9:52pm UTC](https://discuss.elastic.co/t/convert-millisecond-epoch-time-to-iso-human-readable-time/114178/1 "2018-01-04T21:52:53Z")

</div>

I have a field that is represented in milliseconds since epoch. I want to use this field as the x axis of a histogram bar chart but I want the dates to be human readable. See the screenshot of what it looks like now. What are some ways to do this?

 ![10 PM](https://us1.discourse-cdn.com/elastic/original/3X/3/f/3f81329495be9797dff7d1a92ca6e762cb7fb9bb.png)

---

<div class="post-metadata">

### Author: ![murlin99](https://avatars.discourse-cdn.com/v4/letter/m/5f8ce5/32.png) [@murlin99](https://discuss.elastic.co/u/murlin99)
#### Post date: [January 4, 2018, 9:57pm UTC](https://discuss.elastic.co/t/convert-millisecond-epoch-time-to-iso-human-readable-time/114178/2 "2018-01-04T21:57:52Z")

</div>

It looks like you are storing the epoch as an integer. You have to specify something like this in your index mapping  
"startTime": {  
"format": "epoch\_millis",  
"type": "date"  
}

---

<div class="post-metadata">

### Author: ![jeremymclain](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jeremymclain/32/26254_2.png) [@jeremymclain](https://discuss.elastic.co/u/jeremymclain)
#### Post date: [January 4, 2018, 10:04pm UTC](https://discuss.elastic.co/t/convert-millisecond-epoch-time-to-iso-human-readable-time/114178/3 "2018-01-04T22:04:16Z")

</div>

@murlin99 Thanks. That makes sense. Unfortunately, I didn't create the original mapping. It's created by a third party plugin to Jenkins build server. I'm just getting familiar with Kibana. Is this something I should be able to do from the Management tab in Kibana? The type doesn't seem to be editable.

Is there a way to make a field that is derived from the startTime field with the appropriate type and format?

 ![36 PM](https://us1.discourse-cdn.com/elastic/original/3X/3/3/33c6a875ed9bd6bba226cf70f0fd555798135b3a.png)

---

<div class="post-metadata">

### Author: ![jeremymclain](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jeremymclain/32/26254_2.png) [@jeremymclain](https://discuss.elastic.co/u/jeremymclain)
#### Post date: [January 4, 2018, 11:11pm UTC](https://discuss.elastic.co/t/convert-millisecond-epoch-time-to-iso-human-readable-time/114178/4 "2018-01-04T23:11:45Z")

</div>

I was able to solve this using a scripted field. I understand that this isn't the most performant way to do it but it works. This is what I came up with for the scripted field:

 ![41 PM](https://us1.discourse-cdn.com/elastic/original/3X/a/8/a82d988a4ec3a922611bd5d009077e1e3f568002.png)

 ![02 PM](https://us1.discourse-cdn.com/elastic/original/3X/a/9/a96139d8d0339c0a0ccc9b06224a051784037592.png)

---

<div class="post-metadata">

### Author: ![murlin99](https://avatars.discourse-cdn.com/v4/letter/m/5f8ce5/32.png) [@murlin99](https://discuss.elastic.co/u/murlin99)
#### Post date: [January 4, 2018, 11:33pm UTC](https://discuss.elastic.co/t/convert-millisecond-epoch-time-to-iso-human-readable-time/114178/5 "2018-01-04T23:33:46Z")

</div>

That is exactly what I was going to suggest in that situation. I have had to use painless in a few area's one of them being the same issue you were dealing with.

Cool you got it working.

---

<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: [February 1, 2018, 11:33pm UTC](https://discuss.elastic.co/t/convert-millisecond-epoch-time-to-iso-human-readable-time/114178/6 "2018-02-01T23:33:57Z")

</div>

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