Compartilhar via


EnumDateFormats (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.

BOOLEnumDateFormats(DATEFMT_ENUMPROClpDateFmtEnumProc, LCIDLocale, DWORDdwFlags);

Parameters

  • lpDateFmtEnumProc
    [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.
  • Locale
    [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.
    Value Description
    LOCALE_SYSTEM_DEFAULT Default system locale.
    LOCALE_USER_DEFAULT Default user locale.
    LOCALE_NEUTRAL Default language-neutral locale.
  • dwFlags
    [in] Value that specifies the date formats that are of interest. The following table shows the values this parameter can take.
    Value Description
    DATE_SHORTDATE Return short date formats.
    DATE_LONGDATE Return 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**.**

Value Description
ERROR_BADDB The configuration registry database is corrupt.
ERROR_INVALID FLAGS The flags are invalid.
ERROR_INVALID_PARAMETER The parameter is incorrect.

Remarks

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.

Locale Date Format
United Kingdom dd/MM/yyyy
Canada dd/MM/yyyy
New Zealand dd/MM/yyyy
Ireland dd/MM/yyyy
South Africa dd/MM/yyyy
Caribbean MM/dd/yyyy
Belize dd/MM/yyyy
Trinidad dd/MM/yyyy

Requirements

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.