# Duration field formatter hh:mm:ss

**URL:** https://discuss.elastic.co/t/duration-field-formatter-hhss/268533
**Category:** Kibana
**Tags:** kibana-plugin-development
**Created:** [March 26, 2021, 7:12pm UTC](https://discuss.elastic.co/t/duration-field-formatter-hhss/268533 "2021-03-26T19:12:55Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Carl\_Schneidinger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carl_schneidinger/32/78091_2.png) [@Carl\_Schneidinger](https://discuss.elastic.co/u/Carl_Schneidinger)
#### Post date: [March 26, 2021, 7:12pm UTC](https://discuss.elastic.co/t/duration-field-formatter-hhss/268533/1 "2021-03-26T19:12:56Z")

</div>

I have a number field that represents a time duration in seconds. I set this field as duration in an index pattern. My end users want to see the time duration in hh:mm:ss instead of number of seconds/minutes/hours. The human readable option does not have the required precision.

I think that a plugin can be developed to do this. Does anyone have any examples of how to do this? It is not clear to me how to add a formatter to core services.

---

<div class="post-metadata">

### Author: ![wylie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wylie/32/81794_2.png) [@wylie](https://discuss.elastic.co/u/wylie)
#### Post date: [March 26, 2021, 7:27pm UTC](https://discuss.elastic.co/t/duration-field-formatter-hhss/268533/2 "2021-03-26T19:27:37Z")

</div>

Hi, and welcome to the community. This is a non-obvious feature of the Kibana numeral patterns, which you can use since your data is in seconds: [Numeral Formatting | Kibana Guide [7.12] | Elastic](https://www.elastic.co/guide/en/kibana/current/numeral.html#_duration_formatting)

You can set this pattern under the Number format for your field.

---

<div class="post-metadata">

### Author: ![Carl\_Schneidinger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carl_schneidinger/32/78091_2.png) [@Carl\_Schneidinger](https://discuss.elastic.co/u/Carl_Schneidinger)
#### Post date: [March 26, 2021, 8:14pm UTC](https://discuss.elastic.co/t/duration-field-formatter-hhss/268533/3 "2021-03-26T20:14:01Z")

</div>

Thanks for your help. That works perfectly.

To review:  
In order to display a numeric field as hh:mm:ss (duration has to be in seconds).  
In index patterns change formatter from "duration" to "numeric" for the field  
Set the format pattern to: 00:00:00

Now the formatter converts number of seconds to hh:mm:ss

---

<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: [April 23, 2021, 8:14pm UTC](https://discuss.elastic.co/t/duration-field-formatter-hhss/268533/4 "2021-04-23T20:14:02Z")

</div>

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