Formats a duration of time as a time string for a locale specified by identifier.
int GetDurationFormat( LCID Locale, DWORD dwFlags, const SYSTEMTIME *lpDuration, ULONGLONG ullDuration, LPCWSTR lpFormat, LPWSTR lpDurationStr, int cchDuration );
Flags specifying function options. If lpFormat is not set to NULL, this parameter must be set to 0. If lpFormat is set to NULL, your application can specify LOCALE_NOUSEROVERRIDE to format the string using the system default duration format for the specified locale.
Pointer to a SYSTEMTIME structure that contains the time duration information to format. If this pointer is NULL, the function ignores this parameter and uses ullDuration.
64-bit unsigned integer that represents the number of 100-nanosecond intervals in the duration. If both lpDuration and ullDuration are present, lpDuration takes precedence. If lpDuration is set to NULL and ullDuration is set to 0, the duration is zero.
Pointer to the format string. For details, see the lpFormat parameter of GetDurationFormatEx.
Pointer to the buffer in which the function retrieves the duration string.
Alternatively, this parameter can contain NULL if cchDuration is set to 0. In this case, the function returns the required size for the duration string buffer.
Size, in characters, of the buffer indicated by lpDurationStr.
Alternatively, the application can set this parameter to 0. In this case, the function retrieves NULL in lpDurationStr and returns the required size for the duration string buffer.
Returns the number of characters retrieved in the buffer indicated by lpDurationStr if successful. If lpDurationStr is set to NULL and cchDuration is set to 0, the function returns the required size for the duration string buffer, including the null terminating character. For example, if 10 characters are written to the buffer, the function returns 11 to include the terminating null character.
The function returns 0 if it does not succeed. To get extended error information, the application can call GetLastError, which can return one of the following error codes:
- ERROR_INSUFFICIENT_BUFFER. A supplied buffer size was not large enough, or it was incorrectly set to NULL.
- ERROR_INVALID_PARAMETER. Any of the parameter values was invalid.
See Remarks for GetDurationFormatEx.
|Minimum supported client||Windows Vista [desktop apps only]|
|Minimum supported server||Windows Server 2008 [desktop apps only]|
|Header||winnls.h (include Windows.h)|