Windows Dev Center

Expand Minimize

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.

Windows Phone 8.1: This API is supported.

Requirements

Header

OleAuto.h

Library

OleAut32.lib

DLL

OleAut32.dll

See also

VarTokenizeFormatString
VarFormatFromTokens
Formatting Routines

 

 

Community Additions

ADD
Show:
© 2015 Microsoft