This function enumerates the long or short date formats that are available for a specified locale, including date formats for any alternate calendars.
At a Glance
Header file: | Winnls.h |
Windows CE versions: | 1.0 and later |
Syntax
BOOL EnumDateFormats(DATEFMT_ENUMPROC lpDateFmtEnumProc, LCID Locale, DWORD dwFlags);
Parameters
lpDateFmtEnumProc
[in] Pointer to an application-defined callback function. The EnumDateFormats function enumerates date formats by making repeated calls to this callback function. For more information, see the EnumDateFormatsProc callback function.
Locale
[in] Specifies the locale to retrieve date format information for. This parameter can be a locale identifier created by the MAKELCID macro, or one of the following predefined values:
Value | Description |
LOCALE_SYSTEM_DEFAULT | Default system locale. |
LOCALE_USER_DEFAULT | Default user locale. |
LOCALE_NEUTRAL | Default language-neutral locale. |
dwFlags
[in] Specifies the date formats that are of interest. Use one of the following values:
Value | Description |
DATE_SHORTDATE | Return short date formats. |
DATE_LONGDATE | Return long date formats. |
Return Values
Nonzero indicates success. Zero indicates failure. To get extended error information, call GetLastError. Possible values for GetLastError include the following:
Remarks
The DATE_SHORTDATE and DATE_LONGDATE flags are mutually exclusive. Use one or the other, but not both.
For Windows CE versions 2.10 and later, default DATE_SHORTDATE formats for non-U.S. English locales that include the four-digit year are added. The following table shows the formats.
Locale | Date Format |
United Kingdom | dd/MM/yyyy |
Canada | dd/MM/yyyy |
New Zealand | dd/MM/yyyy |
Ireland | dd/MM/yyyy |
South Africa | dd/MM/yyyy |
Caribbean | MM/dd/yyyy |
Belize | dd/MM/yyyy |
Trinidad | dd/MM/yyyy |
See Also