Skip to content

Latest commit

 

History

History
149 lines (108 loc) · 6.78 KB

nf-winnls-enumdateformatsexw.md

File metadata and controls

149 lines (108 loc) · 6.78 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:winnls.EnumDateFormatsExW
EnumDateFormatsExW function (winnls.h)
Enumerates the long date, short date, or year/month formats that are available for a specified locale.Note  Any application that runs only on Windows Vista and later should use EnumDateFormatsExEx in preference to this function. (Unicode)
EnumDateFormatsEx
EnumDateFormatsEx function [Internationalization for Windows Applications]
EnumDateFormatsExW
_win32_EnumDateFormatsEx
intl.enumdateformatsex
winnls/EnumDateFormatsEx
winnls/EnumDateFormatsExW
intl\enumdateformatsex.htm
Intl
523ef50f-722a-48b9-a2ce-20786b7c79e1
12/05/2018
EnumDateFormatsEx, EnumDateFormatsEx function [Internationalization for Windows Applications], EnumDateFormatsExA, EnumDateFormatsExW, _win32_EnumDateFormatsEx, intl.enumdateformatsex, winnls/EnumDateFormatsEx, winnls/EnumDateFormatsExA, winnls/EnumDateFormatsExW
winnls.h
Windows.h
Windows
Windows 2000 Professional [desktop apps only]
Windows 2000 Server [desktop apps only]
EnumDateFormatsExW (Unicode) and EnumDateFormatsExA (ANSI)
Kernel32.lib
Kernel32.dll
Windows
19H1
EnumDateFormatsExW
winnls/EnumDateFormatsExW
c++
APIRef
kbSyntax
DllExport
Kernel32.dll
API-MS-Win-Core-Localization-l2-1-0.dll
KernelBase.dll
API-MS-Win-Core-Localization-Ansi-L1-1-0.dll
Kernel32Legacy.dll
EnumDateFormatsEx
EnumDateFormatsExA
EnumDateFormatsExW

EnumDateFormatsExW function

-description

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

Note  Any application that runs only on Windows Vista and later should use EnumDateFormatsExEx in preference to this function.
 

-parameters

-param lpDateFmtEnumProcEx [in]

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

-param Locale [in]

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.

Windows Vista and later: The following custom locale identifiers are also supported.

-param dwFlags [in]

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

-returns

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.
 
The function enumerates the date formats by passing date format string pointers, one at a time, to the specified application-defined callback function. This process continues until EnumDateFormatsEx finds the last date format or the callback function returns FALSE.

This function enumerates all date formats for the specified locale, including alternate calendars, if any. However, the calendar identifier is not enumerated along with the date format, making formats for locales with alternate calendars difficult to use.

This function can enumerate data from custom locales. Data is not guaranteed to be the same from computer to computer or between runs of an application. If your application must persist or transmit data, see Using Persistent Locale Data.

When the ANSI version of this function is used with a Unicode-only locale identifier, the function can succeed because the operating system uses the system code page. However, characters that are undefined in the system code page appear in the string as a question mark (?).

The application should use EnumDateFormatsEx (instead of EnumDateFormats) to enumerate date formats for locales with alternate calendars.

Note

The winnls.h header defines EnumDateFormatsEx as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.

-see-also

EnumDateFormats

EnumDateFormatsExEx

EnumDateFormatsProcEx

National Language Support

National Language Support Functions