Function Reference


_WinAPI_GetDurationFormat

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

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

Parameters

$iLCID The locale identifier (LCID) that specifies the locale or one of the following predefined values:
    $LOCALE_INVARIANT
    $LOCALE_SYSTEM_DEFAULT
    $LOCALE_USER_DEFAULT
Windows Vista or later
    $LOCALE_CUSTOM_DEFAULT
    $LOCALE_CUSTOM_UI_DEFAULT
    $LOCALE_CUSTOM_UNSPECIFIED
$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.

Remarks

This function requires Windows Vista or later.

See Also

Search GetDurationFormat in MSDN Library.

Example

#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)