This topic has not yet been rated - Rate this topic

EnumDateFormatsExEx function

Applies to: desktop apps | Metro style apps

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

Note  The application should call this function in preference to EnumDateFormats or EnumDateFormatsEx if designed to run only on Windows Vista and later.

Note  This function can enumerate data that changes between releases, for example, due to a custom locale. If your application must persist or transmit data, see Using Persistent Locale Data.

Syntax

BOOL EnumDateFormatsExEx(
  __in      DATEFMT_ENUMPROCEXEX lpDateFmtEnumProcExEx,
  __in_opt  LPCWSTR lpLocaleName,
  __in      DWORD dwFlags,
  __in      LPARAM lParam
);

Parameters

lpDateFmtEnumProcExEx [in]

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

lpLocaleName [in, optional]

Pointer to a locale name, or one of the following predefined values.

dwFlags [in]

Flag specifying date formats. The application can supply one of the following values or the LOCALE_USE_CP_ACP constant.

ValueMeaning
DATE_SHORTDATE

Use short date formats. This value cannot be used with DATE_LONGDATE or DATE_YEARMONTH.

DATE_LONGDATE

Use long date formats. This value cannot be used with DATE_SHORTDATE or DATE_YEARMONTH.

DATE_YEARMONTH

Use year/month formats. This value cannot be used with DATE_SHORTDATE or DATE_LONGDATE.

 

lParam [in]

An application-provided parameter to pass to the callback function. This value is especially useful for multi-threaded applications.

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_BADDB. The function could not access the data. This situation should not normally occur, and typically indicates a bad installation, a disk problem, or the like.
  • ERROR_INVALID_FLAGS. The values supplied for flags were not valid.
  • ERROR_INVALID_PARAMETER. Any of the parameter values was invalid.

Remarks

The function enumerates the date formats by passing date format string pointers, one at a time, to the specified application-defined callback function, along with an application-defined constant that is useful for multi-threaded applications. This process continues until EnumDateFormatsExEx finds the last date format or the callback function returns FALSE.

Requirements

Minimum supported client

Windows Vista

Minimum supported server

Windows Server 2008

Header

Winnls.h (include Windows.h)

Library

Kernel32.lib

DLL

Kernel32.dll

See also

National Language Support
National Language Support Functions
EnumDateFormats
EnumDateFormatsEx
EnumDateFormatsProcExEx

 

 

Send comments about this topic to Microsoft

Build date: 3/6/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ