The value returned in will always be in the form "hh hours mm minutes ss seconds". Times that exceed twenty four hours are not converted to days or months. Fractions of seconds are ignored.
Code: Select all
#NoEnv
SetBatchLines, -1
MsgBox, % StrFromTimeInterval(3600)
ExitApp
; ----------------------------------------------------------------------------------------------------------------------
StrFromTimeInterval(Seconds) {
; http://msdn.microsoft.com/en-us/library/bb759980(v=vs.85).aspx
VarSetCapacity(Result, 128, 0)
DllCall("Shlwapi.dll\StrFromTimeInterval", "Str", Result, "UInt", 64, "UInt", Seconds * 1000, "Int", 30)
Return Result
}