Platform SDK: International Features

EnumDateFormatsEx

The EnumDateFormatsEx function enumerates the long or short date formats that are available for a specified locale, including date formats for any alternate calendars. The value of the dwFlags parameter determines whether the long date, short date, or year/month formats are enumerated. The function enumerates the date formats by passing date format string pointers, one at a time, to the specified application defined–callback function. This continues until the last date format is found or the callback function returns FALSE.

BOOL EnumDateFormatsEx (
  DATEFMT_ENUMPROCEX lpDateFmtEnumProcEx, // callback function
  LCID Locale,                            // locale
  DWORD dwFlags                           // date formats
);

Parameters

lpDateFmtEnumProcEx
[in] Pointer to an application defined–callback function. The EnumDateFormatsEx function enumerates date formats by making repeated calls to this callback function. For more information, see the EnumDateFormatsProcEx callback function.
Locale
[in] Specifies the locale for which to retrieve date format information. This parameter can be a locale identifier created by the MAKELCID macro, or one of the following predefined values.
Value Meaning
LOCALE_SYSTEM_DEFAULT Default system locale.
LOCALE_USER_DEFAULT Default user locale.

dwFlags
[in] Specifies the date formats that are of interest. Use one of the following values.
Value Meaning
LOCALE_USE_CP_ACP Uses the system ANSI code page for string translation instead of the locale's code page.
DATE_SHORTDATE Return short date formats. This value cannot be used with DATE_LONGDATE.
DATE_LONGDATE Return long date formats. This value cannot be used with DATE_SHORTDATE.
DATE_YEARMONTH Return year/month formats.

Return Values

If the function succeeds, the return values is a nonzero value.

If the function fails, the return value is zero. To get extended error information, call GetLastError. GetLastError may return one of the following error codes:

Remarks

Windows 2000: The ANSI version of this function will fail if it is used with a Unicode-only LCID. See Language Identifiers.

Requirements

  Windows NT/2000: Requires Windows 2000.
  Windows 95/98: Requires Windows 98.
  Header: Declared in Winnls.h; include Windows.h.
  Library: Use Kernel32.lib.

See Also

National Language Support Overview, National Language Support Functions, EnumDateFormatsProcEx, EnumCalendarInfo, EnumTimeFormats