This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
We have extended our Early Bird Tickets for Inspire 2023! Discounted pricing goes until February 24th. Save your spot!
Hi All,
I am trying to convert seconds from an integer format into HH:MM:SS. Any suggestions?
Thanks
Solved! Go to Solution.
Assuming less than 24 hours. I suggest a formula tool creating a Time column:
DateTimeAdd("1900-01-01",[seconds],"seconds")
To cope with more than that I suggest. Same formula producing a DateTime as a string. Then a second formula step getting days difference and adding to hours.
PadLeft(ToString( DateTimeDiff([Time],"1900-01-01","days")*24 + ToNumber(Substring([Time],11,2)) ), 2,"0") + Substring([Time],13,8)
Sample attached
Or you can do:
PadLeft(ToString(Mod([Seconds]/3600,3600)),2,"0")+":"+
PadLeft(ToString(Mod([Seconds]/60,60)),2,"0")+":"+
PadLeft(ToString(Mod([Seconds],60)),2,"0")
Merge the two :)
PadLeft(ToString(Floor([Seconds]/3600)),2,"0") + Right(DateTimeAdd("1900-01-01",[seconds],"seconds"),6)
Should work for all time periods.
thank you both, will try this out.
Hi all,
I have tried to convert a time int32 (seconds) into hh:mm:ss where the record as follows
Records Sum_TimeTaken
1 10068859
How do i convert this time which is in seconds (int32) into hh:mm:ss