# Function Reference

# _WinAPI_GetTimeFormat

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

#include <WinAPILocale.au3>
_WinAPI_GetTimeFormat ( [$iLCID = 0 [, $tSYSTEMTIME = 0 [, $iFlags = 0 [, $sFormat = '']]]] )

## Parameters

$iLCID | [optional] 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
$tSYSTEMTIME | [optional] $tagSYSTEMTIME structure that contains the time information to format. If this parameter is 0 (Default), the function will use the current local system time.
$iFlags | [optional] The flags that specifies the time format options. This parameter can be one or more of the following values. $TIME_FORCE24HOURFORMAT $TIME_NOMINUTESORSECONDS $TIME_NOSECONDS $TIME_NOTIMEMARKER
$sFormat | [optional] The string that is used to form the time. For example, "hh:mm:ss tt". If this parameter is omitted or an empty string (Default), the function returns the string according to the time format for the specified locale.

## Return Value

Success: | The formatted time string.
Failure: | Sets the @error flag to non-zero, call _WinAPI_GetLastError() to get extended error information.

## See Also

Search GetTimeFormat in MSDN Library.

## Example

    #include <WinAPILocale.au3>

    ConsoleWrite(_WinAPI_GetTimeFormat() & @CRLF)
    ConsoleWrite(_WinAPI_GetTimeFormat(0, 0, BitOR($TIME_FORCE24HOURFORMAT, $TIME_NOSECONDS)) & @CRLF)