다음을 통해 공유


formatDate Method (Windows Embedded CE 6.0)

1/6/2010

Formats the date using the specified formatting options.

Script Syntax

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

Remarks

Ee503500.collapse(en-US,WinEmbedded.60).gifScript 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.

Ee503500.collapse(en-US,WinEmbedded.60).gifScript 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.

Ee503500.collapse(en-US,WinEmbedded.60).gifC/C++ Syntax

HRESULT formatDate(
  VARIANT varDate,
  BSTR bstrFormat,
  VARIANT varDestLocale,
  BSTR* pbstrFormattedString
);

Remarks

Ee503500.collapse(en-US,WinEmbedded.60).gifC/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.

Ee503500.collapse(en-US,WinEmbedded.60).gifC/C++ Return Values

  • S_OK
    Value returned if successful.

Ee503500.collapse(en-US,WinEmbedded.60).gifRequirements

Header msxml2.h, msxml2.idl
Library uuid.lib
Windows Embedded CE Windows CE .NET 4.0 and later

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.

See Also

Reference

XSLT Methods