函数参考


_WinAPI_GetDurationFormat

Formats a duration of time as a time string for a locale specified by identifier.

#Include <WinAPIEx.au3>
_WinAPI_GetDurationFormat ( $LCID, $iDuration [, $sFormat] )

参数

$LCID Locale identifier (LCID) that specifies the locale for which this function formats the duration.
If this parameter is 0, the function uses a default locale for the user.
$iDuration The number of 100-nanosecond intervals in the duration. Alternatively, this parameter can be
a $tagSYSTEMTIME structure that contains the time duration information to format.
$sFormat [可选参数] The string that is used to form the duration. For example, "hh:mm:ss.ff". If this parameter is
omitted or an empty string, the function returns the string according to the duration format
for the specified locale ($LCID).

返回值

Success The formatted duration string.
Failure Empty string and sets the @error flag to non-zero.

注意/说明

本函数需要 Windows Vista 或更高版本系统.

相关

详情参考

在MSDN中搜索


示例/演示


#Include <WinAPIEx.au3>

Opt('MustDeclareVars', 1)

Global $Duration = (90 * 60 + 14) * 1000 * 1000 * 10

ConsoleWrite(_WinAPI_GetDurationFormat(0, $Duration, 'hh:mm:ss') & @CR)
ConsoleWrite(_WinAPI_GetDurationFormat(0, $Duration, 'mm:ss') & @CR)
ConsoleWrite(_WinAPI_GetDurationFormat(0, $Duration, 'ss') & @CR)