Function Reference


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

#include <WinAPILocale.au3>
_WinAPI_GetDurationFormat ( $iLCID, $iDuration [, $sFormat = ''] )


$iLCID The locale identifier (LCID) that specifies the locale or one of the following predefined values:
Windows Vista or later
$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 [optional] The string that is used to form the duration. For example, "hh:mm:ss.ff".
If this parameter is omitted or an empty string (Default), the function returns the string according to the duration format for the specified locale.

Return Value

Success: The formatted duration string.
Failure: Empty string, call _WinAPI_GetLastError() to get extended error information.


This function requires Windows Vista or later.

See Also

Search GetDurationFormat in MSDN Library.


#include <WinAPILocale.au3>

Local $iDuration = (90 * 60 + 14) * 1000 * 1000 * 10

ConsoleWrite(_WinAPI_GetDurationFormat(0, $iDuration, 'hh:mm:ss') & @CRLF)
ConsoleWrite(_WinAPI_GetDurationFormat(0, $iDuration, 'mm:ss') & @CRLF)
ConsoleWrite(_WinAPI_GetDurationFormat(0, $iDuration, 'ss') & @CRLF)