VarFormatDateTime function (oleauto.h)
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
[in] pvarIn
The variant containing the value to format.
[in] iNamedFormat
The named date formats are as follows.
Value | Meaning |
---|---|
|
General date |
|
Long date |
|
Short date |
|
Long time |
|
Short time |
[in] dwFlags
VAR_CALENDAR_HIJRI is the only flag that can be set.
[out] pbstrOut
Receives the formatted string that represents the variant.
Return value
This function can return one of these values.
Return code | Description |
---|---|
|
Success. |
|
One or more of the arguments is not valid. |
Remarks
This function uses the user's default locale while calling VarTokenizeFormatString and VarFormatFromTokens.
Requirements
Requirement | Value |
---|---|
Target Platform | Windows |
Header | oleauto.h |
Library | OleAut32.lib |
DLL | OleAut32.dll |