
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Show time as hh:mm:ss format
Suppose I have a [Time]: 164551 seconds. I want it to show with hh:mm:ss format.
I tried two ways, but neither worked.
1. If I put my function as [Time], choose number formatting as Duration and format pattern as h:mm:ss, then it shows as 3949224:00:00, which is the wrong result.
2. If I put my function as time([Time],'hh:mm:ss'), the result also shows as 3949224:00:00.
What's wrong with these two methods? What should I do?
Thanks in advance!
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Maybe someone else will come with a more meaningful response. You may want to forgo using the format in the UI, and try formatting it in the dimension.
Try something like this:
Data:
TestData:
LOAD * Inline
[
'UserId', 'seconds'
1, 164551
]
;
EXIT Script
;
UI;
=Interval(seconds/86400,'h:mm:ss')
On another note, I'm not sure why my original attempt at Time(Time#(seconds,'s'),'hh:mm ss') didn't work and gave me the wrong answer.
Hope this helps.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try this
Time(Time#([Time], 'ss'),'hh:mm:ss')

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Maybe someone else will come with a more meaningful response. You may want to forgo using the format in the UI, and try formatting it in the dimension.
Try something like this:
Data:
TestData:
LOAD * Inline
[
'UserId', 'seconds'
1, 164551
]
;
EXIT Script
;
UI;
=Interval(seconds/86400,'h:mm:ss')
On another note, I'm not sure why my original attempt at Time(Time#(seconds,'s'),'hh:mm ss') didn't work and gave me the wrong answer.
Hope this helps.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for help!
I tried with Time(Time#([Time], 'ss'),'hh:mm:ss') and number formatting: Auto. The result was 21:42:31, which I don't think matches 164551 seconds?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Sunny,
For some reason, this gives the wrong answer, it gives 21 hours and some change. I'm not quite sure why this doesn't work.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Do you mean seeing 21:42:31 instead of 45:42:31? I guess time function only shows time and skips the day... May be this
=Interval(Interval#(164551, 's'), 'hh:mm:ss')

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try this or what Justin gave
=Interval(Interval#(164551, 's'), 'hh:mm:ss')

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you very much!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you very much!
