IDataFunctions::ConvertDateTimeString
The ConvertDateTimeString method converts string representation of the date/time to a DATE VARIANT, based on the specified locale.
Syntax
HRESULT ConvertDateTimeString(
VARIANT vtDateTime,// in
VARIANT vtLocale,// in
VARIANT *pvarDate// out
);
Parameters
-
vtDateTime
-
A VARIANT that contains the string representation of the date/time. The vt member of this VARIANT must be initialized to VT_BSTR, and its pbstrVal member must contain the BSTR value to convert.
-
vtLocale
-
A VARIANT that specifies the locale to be used to perform the conversion. If this VARIANT is empty (VT_EMPTY) or NULL (VT_NULL), ConvertDateString uses the locale specified by a previous call to put_Locale.
-
pvarDate
-
If successful, a pointer to a VARIANT that contains the converted value; otherwise, NULL. Note that the vtDateTime passed to this method must contain only the time. If it contains the date also, ConvertTimeString sets pvarDate VARIANT pointer to NULL.
Include
<commerce.h>
Return Values
Value |
Description |
|
S_OK |
The conversion was successful. |
DISP_E_TYPEMISMATCH |
The value in vtDate is not a BSTR value. |
Related Topic
IDataFunctions::ConvertDateString, IDataFunctions::ConvertTimeString
© 1997-1998 Microsoft Corporation. All rights reserved.