Windows apps
Collapse the table of content
Expand the table of content

VarFormatDateTime Function

Formats a variant containing named date and time information into a string.

HRESULT VarFormatDateTime(
  LPVARIANT pvarIn,
  int   iNamedFormat,
  ULONG dwFlags,
  BSTR *pbstrOut
);

pvarIn

[in] The variant containing the value to format.

iNamedFormat

[in] The named date formats are: 0 = General Date, 1 = Long Date, 2 = Short Date, 3 = Long Time and 4 = Short Time.

dwFlags

[in] VAR_CALENDAR_HIJRI is the only flag that can be set.

pbstrOut

[out] Points to the formatted string that represents the variant.

The function returns one of the following:

Return value

Meaning

S_OK

Success.

E_INVALIDARG

One or more of the arguments is invalid.

This functions uses the user's default locale while calling VarTokenizeFormatString and VarFormatFromTokens.

Show:
© 2017 Microsoft