# Storing Time Data (not Date/Timestamp)

**URL:** <https://discuss.elastic.co/t/storing-time-data-not-date-timestamp/70169>\
**Category:** Elasticsearch\
**Created:** [December 28, 2016, 11:21pm UTC](https://discuss.elastic.co/t/storing-time-data-not-date-timestamp/70169 "2016-12-28T23:21:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![efahsl](https://avatars.discourse-cdn.com/v4/letter/e/9f8e36/32.png) [@efahsl](https://discuss.elastic.co/u/efahsl)\
**Post date:** [December 28, 2016, 11:21pm UTC](https://discuss.elastic.co/t/storing-time-data-not-date-timestamp/70169/1 "2016-12-28T23:21:39Z")

</div>

Hi all, have been wracking my brain on this for a little bit.

I am trying to store time data for race results in ES, but do NOT need the date or time zone (For example, person X completed a marathon race in 3:04:23). Is there a way to store a time in just HH:MM:SS format?

Some options I found and their drawbacks:

1. Store as a date, with mapping type of "date" and "format" : "HH:mm:ss". Downside: time zone appears to affect the data when viewing in Kibana. For example, "5:24:50" is interpreted as: "December 31st 1969, 21:24:50.000"
2. Store as a string. This renders and searches OK, but prevents me from performing any operations (mean, min, max, etc)
3. Convert to seconds and store as a numeric. Requires converting data in between formats for analysis. This seems the most promising option, just requires some additional work.

Any thoughts are appreciated.

Thanks,  
Eric

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [December 29, 2016, 4:37am UTC](https://discuss.elastic.co/t/storing-time-data-not-date-timestamp/70169/2 "2016-12-29T04:37:58Z")

</div>

I'd probably go with option 3 here.  
May be transforming to seconds is something doable with a Node Ingest pipeline?

You can create a date like 1/1/1970 + your time but I don't really see any advantage of doing that.

My 0.05 cents!

---

<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:** [January 26, 2017, 4:38am UTC](https://discuss.elastic.co/t/storing-time-data-not-date-timestamp/70169/3 "2017-01-26T04:38:08Z")

</div>

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