Function Reference


Formats a date as a date string for a locale specified by the locale identifier

#include <WinAPILocale.au3>
_WinAPI_GetDateFormat ( [$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 date information to format.
If this parameter is 0 (Default), the function will use the current local system date.
$iFlags [optional] The flags that specifies the date format options.
This parameter can be one or more of the following values:
    $DATE_SHORTDATE (Default)
Windows Vista or later
Windows 7 or later
$sFormat [optional] The string that is used to form the date. For example, "dddd MMMM, yyyy".
If this parameter is omitted or an empty string (Default), the function returns the string according to the date format for the specified locale.

Return Value

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

See Also

Search GetDateFormat in MSDN Library.


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

ConsoleWrite(_WinAPI_GetDateFormat() & @CRLF)
ConsoleWrite(_WinAPI_GetDateFormat(0, 0, $DATE_LONGDATE) & @CRLF)
ConsoleWrite(_WinAPI_GetDateFormat(0, 0, 0, 'dddd dd, yyyy') & @CRLF)