Hi All,
I am trying to convert seconds from an integer format into HH:MM:SS. Any suggestions?
Thanks
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.