Function Reference


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

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


$iLCID [optional] The locale identifier (LCID) that specifies the locale or one of the following predefined values.

Windows Vista or later
$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.
$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.


#include <APILocaleConstants.au3>
#include <WinAPILocale.au3>

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