EnumDateFormatsA function

Enumerates the long date, short date, or year/month formats that are available for a specified locale.

Note  To receive a calendar identifier in addition to date format information, the application should use the EnumDateFormatsEx function. Another reason for preferring this function is that Microsoft is migrating toward the use of locale names instead of locale identifiers for new locales, for interoperability reasons.
 
Note  Any application that will be run only on Windows Vista or later should use EnumDateFormatsExEx in preference to EnumDateFormats.
 

Syntax

BOOL EnumDateFormatsA(
  DATEFMT_ENUMPROCA lpDateFmtEnumProc,
  LCID              Locale,
  DWORD             dwFlags
);

Parameters

lpDateFmtEnumProc

Pointer to an application-defined callback function. For more information, see EnumDateFormatsProc.

Locale

Locale identifier that specifies the locale for which to retrieve date format information. You can use the MAKELCID macro to create an identifier or use one of the following predefined values.

dwFlags

Flag specifying date formats. For detailed definitions, see the dwFlags parameter of EnumDateFormatsExEx.

Return Value

Returns a nonzero value if successful, or 0 otherwise. To get extended error information, the application can call GetLastError, which can return one of the following error codes:

  • ERROR_INVALID_FLAGS. The values supplied for flags were not valid.
  • ERROR_INVALID_PARAMETER. Any of the parameter values was invalid.

Remarks

Note  This API is being updated to support the May 2019 Japanese era change. If your application supports the Japanese calendar, you should validate that it properly handles the new era. See Prepare your application for the Japanese era change for more information.
 
For details of operation of this function, see Remarks in EnumDateFormatsEx.
Note  To enumerate the date formats for locales with alternate calendars, the application should use EnumDateFormatsEx.
 

Requirements

   
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header winnls.h (include Windows.h)
Library Kernel32.lib
DLL Kernel32.dll

See Also

EnumDateFormatsEx

EnumDateFormatsExEx

EnumDateFormatsProc

National Language Support

National Language Support Functions