Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

VarFormatDateTime function

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

Syntax


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

Parameters

pvarIn [in]

The variant containing the value to format.

iNamedFormat [in]

The named date formats are as follows.

ValueMeaning
0

General date

1

Long date

2

Short date

3

Long time

4

Short time

 

dwFlags [in]

VAR_CALENDAR_HIJRI is the only flag that can be set.

pbstrOut [out]

Receives the formatted string that represents the variant.

Return value

This function can return one of these values.

Return codeDescription
S_OK

Success.

E_INVALIDARG

One or more of the arguments is not valid.

 

Remarks

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

Requirements

Header

OleAuto.h

Library

OleAut32.lib

DLL

OleAut32.dll

See also

VarTokenizeFormatString
VarFormatFromTokens
Formatting Routines

 

 

Show:
© 2017 Microsoft