### Convert Seconds Time String

Example Sub to convert number of seconds (as long) to a time string in format HH:mm:ss.
'Convert number of seconds to a time string HH:mm:ss
'Example:
'Log($"${ConvertSecondsToTimeString(3600)}"$)
'Output: 01:00:00
`Sub ConvertSecondsToTimeString(secs As Long) As String
Return ConvertTicksToTimeString(secs * DateTime.TicksPerSecond)
End Sub`
`Sub ConvertTicksToTimeString(t As Long) As String
Dim hours, minutes, seconds As Int
hours = t / DateTime.TicksPerHour
minutes = (t Mod DateTime.TicksPerHour) / DateTime.TicksPerMinute
seconds = (t Mod DateTime.TicksPerMinute) / DateTime.TicksPerSecond
Return $"${NumberFormat(hours, 2, 0)}:${NumberFormat(minutes, 2, 0)}:${NumberFormat(seconds, 2, 0)}"$
End Sub`

Changed: , Category: DateTime, File: T6C183M1321.htm, ID: 1321