Storing Time Data (not Date/Timestamp)

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.


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!

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