Hi,
I'm having trouble with converting seconds to hh:mm:ss format in a text display.
I'm calculating the seconds based on the difference between two time stamps.
anyhelp will be great!
Solved! Go to Solution.
Try this:
Text(RoundDown(DateDiff(CurrentTime,InitialTime,Seconds)/3600,0),"00")&":"&
Text(If(RoundDown(DateDiff(CurrentTime,InitialTime,Seconds)/60,0)>59,0,RoundDown(DateDiff(CurrentTime,InitialTime,Seconds)/60,0)),"00")&":"&
Text(Mod(DateDiff(CurrentTime,InitialTime,Seconds),60),"00")
show us the code you are using
Did you use the DateDiff?
Text(DateDiff(StartTime1,EndTime1,Seconds),"hh:mm:ss")
I'm using this to calculate seconds
(RoundDown((CurrentTime - InitialTime) * 24 * 60 * 60, 0))
Also The hh:mm:ss format doesn't work. I want to see the result like this.
Eg: we have320 seconds the result should be 00h:05m:20s
are date time values using functions now()
Hi @drallam2
Do not use
(RoundDown((CurrentTime - InitialTime) * 24 * 60 * 60, 0))
Use DateDiff to get seconds difference
DateDiff(InitialTime,CurrentTime,Seconds)
To get it to a format 00h:05m:20s you will have to be little more creative
Text(DateAdd(CurrentTime, DateDiff(CurrentTime,InitialTime,Seconds), Seconds),"hh") & "h:"
& Text(DateAdd(CurrentTime, DateDiff(CurrentTime,InitialTime,Seconds), Seconds),"mm") & "m:"
& Text(DateAdd(CurrentTime, DateDiff(CurrentTime,InitialTime,Seconds), Seconds),"ss") & "s"
Unfortunately. I'm not getting the same result. Example for a 2 second elapsed time. For some reason the time shows 9h:59m:58s
Try this:
Text(RoundDown(DateDiff(CurrentTime,InitialTime,Seconds)/3600,0),"00")&":"&
Text(If(RoundDown(DateDiff(CurrentTime,InitialTime,Seconds)/60,0)>59,0,RoundDown(DateDiff(CurrentTime,InitialTime,Seconds)/60,0)),"00")&":"&
Text(Mod(DateDiff(CurrentTime,InitialTime,Seconds),60),"00")
User | Count |
---|---|
122 | |
87 | |
86 | |
75 | |
67 |
User | Count |
---|---|
214 | |
180 | |
137 | |
96 | |
83 |