StrFromTimeInterval()

Post your working scripts, libraries and tools for AHK v1.1 and older
just me
Posts: 9458
Joined: 02 Oct 2013, 08:51
Location: Germany

StrFromTimeInterval()

18 May 2014, 04:44

Converts a time interval, specified in seconds, to a string.

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
}
Related in the old forum: board/topic/4569-tickcount-to-hours-min-sec/
Guest10
Posts: 578
Joined: 01 Oct 2013, 02:50

Re: StrFromTimeInterval()

18 May 2014, 04:54

tested. thanks, it hit the spot!

Return to “Scripts and Functions (v1)”

Who is online

Users browsing this forum: KruschenZ, william_ahk and 121 guests