Compartilhar via


formatDate Method (Windows CE 5.0)

Send Feedback

Formats the date using the specified formatting options.

[Script]

Script Syntax

strValue= oXTLRuntime.formatDate(varDate, bstrFormat, varDestLocale);

Script Parameters

  • varDate
    Variant. Date that is to be formatted.
  • bstrFormat
    String. Specified formatting. See Remarks.

[optional] Variant. Locale to use in determining the correct sequence to be employed in the date. If not supplied, the month-day-year sequence is used.

Script Return Value

String. Returns the string containing the date in the requested format.

The formatDate method is derived from the Win32 application programming interface (API) call, GetDateFormat. Information about this API can be found at this Microsoft Web site.

[C/C++]

C/C++ Syntax

HRESULT formatDate(VARIANTvarDate,BSTRbstrFormat,VARIANTvarDestLocale,BSTR* pbstrFormattedString);

C/C++ Parameters

  • varDate
    [in] Date that is to be formatted.

  • bstrFormat
    [in] Formatting specifics. See Remarks.

  • varDestLocale
    [in, optional] Variant. Locale to use in determining the correct sequence to be employed in the date. If not supplied, the month-day-year sequence is used.

    Note   This parameter is not yet implemented.

  • pbstrFormattedString
    [out, retval] String containing the date in the requested format.

C/C++ Return Values

  • S_OK
    Value returned if successful.

Requirements

OS Versions: Windows CE .NET 4.0 and later.
Header: Msxml2.h, Msxml2.idl.
Link Library: Uuid.lib.

General Remarks

The following table shows the supported date codes.

Date format Meaning
M Months as 1–12
MM Months as 01–12
MMM Months as Jan–Dec
MMMM Months as January–December
MMMMM Months as the first letter of the month
d Days as 1–31
dd Days as 01–31
ddd Days as Sun–Sat
dddd Days as Sunday–Saturday
yy Years as 00–99
yyyy Years as 1900–9999

This method applies to the following interface:

IXTLRuntime.

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.