Retrieving Time Elapsed values in HH:MM:SS format

I’m packaging information in an expression for use with Slack. Part of the payload is Time Elapsed On App.

It seems that Time Elapsed On App outputs it’s value in milliseconds. I’m looking to export the value in a human-readable format, exactly the same as it’s displayed in-app. I’m not a huge fan of doing manual calculations in the expression editor.

At present, I’m using the INTERVAL_TO_SECONDS function, but would like to know if I’m missing a handy function that would provide the value in a HH:MM:SS-like format.

Hi Preston!

I believe that Interval to seconds is your best bet here, but I will check around to see if there are other options!

As a side question for you, why are you not a fan of using expression editor for this type of thing?

Hi Beth!

My issue isn’t inherently with the expression editor, just the effort it would take to convert the interval value into a HH:MM:SS format.

For example, I can use INTERVAL_TO_SECONDS to get the time in seconds, but if I wanted to get it in MM:SS I would need to do something along the lines of

floor(INTERVAL_TO_SECONDS(variable.timeElapsed)/60) + ':' + (INTERVAL_TO_SECONDS(variable.timeElapsed) - 60*floor(variable.timeElapsed/60))

which isn’t ideal. As it’s displayed in-app in that format (rather than seconds/milliseconds), I was hoping there was an easier way to export it in that format (which already exists!).

For reference, one of the intervals I’m tracking is app uptime, which is a value that could range from minutes to hours (to maybe even days).

Okay I understand, that is a lot of work just to get it back into the format that it originally was in - I don’t know off the top of my head of another option but have a question out to some Tulip folks and will report back what I find!

1 Like

@Preston - I confirmed this is currently a limitation in the platform, but the Team is aware and we have an internal ticket to allow more flexibility in how time can be formatted and displayed. I will go ahead and change this to a Product Suggestion as well, so others in the community can vote for it!

1 Like