EnumDateFormats (Windows CE 5.0)

Windows CE 5.0
Send Feedback

This function enumerates the long or short date formats that are available for a specified locale, including date formats for any alternate calendars.

BOOL EnumDateFormats(
  DATEFMT_ENUMPROC lpDateFmtEnumProc, 
  LCID Locale, 
  DWORD dwFlags


[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.
[in] Value that 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. The following table shows the values this parameter can take.
LOCALE_SYSTEM_DEFAULTDefault system locale.
LOCALE_USER_DEFAULTDefault user locale.
LOCALE_NEUTRALDefault language-neutral locale.
[in] Value that specifies the date formats that are of interest. The following table shows the values this parameter can take.
DATE_SHORTDATEReturn short date formats.
DATE_LONGDATEReturn long date formats.

Return Values

Nonzero indicates success. Zero indicates failure. To get extended error information, call the GetLastError function. The following table shows possible return values for the GetLastError function.

ERROR_BADDBThe configuration registry database is corrupt.
ERROR_INVALID FLAGSThe flags are invalid.
ERROR_INVALID_PARAMETERThe parameter is incorrect.


For more information about LCID, see National Language support (NLS) Locale Identifiers.

The DATE_SHORTDATE and DATE_LONGDATE flags are mutually exclusive. Use one or the other, but not both.

For Microsoft Windows CE 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.

LocaleDate Format
United Kingdomdd/MM/yyyy
New Zealanddd/MM/yyyy
South Africadd/MM/yyyy


OS Versions: Windows CE .NET 4.0 and later.
Header: Winnls.h.
Link Library: Coreloc.lib.

See Also

National Language support (NLS) Locale Identifiers | EnumCalendarInfo | EnumDateFormatsProc | EnumTimeFormats | MAKELCID

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.