SWbemDateTime.SetVarDate method

The SetVarDate method of the SWbemDateTime object converts a date in the VT_DATE format to the CIM datetime format.

A VT_DATE value is a variant datetime value that Visual Basic and ActiveX use.

For an explanation of this syntax, see Document Conventions for the Scripting API.

Syntax

SWbemDateTime.SetVarDate( _
  ByVal vdate, _
  [ ByVal bIsLocal ] _
)

Parameters

vdate [in]

The variant date value to set the object. This parameter must be in the VT_DATE format.

bIsLocal [in, optional]

If TRUE, vdate is interpreted as a local time, and the Coordinated Universal Time (UTC) property contains the local time that is converted to the correct UTC offset. When bIsLocal is FALSE, then vdate is converted directly into a UTC value with an offset of zero (0).

Return value

This method does not return a value.

Error codes

After completing the SetVarDate method, the Err object may contain the error code in the following list.

wbemErrInvalidSyntax - 2147749921 (0x80041021)

The format of vdate is not valid.

Remarks

After a successful call to SetVarDate, the DATETIME value is interpreted as an absolute datetime value instead of an interval, and the IsInterval property is set to FALSE.

The intrinsic Visual Basic or VBScript function CDate provides a datetime value in the VT_DATE format for input to SetVarDate.

Examples

For examples of using the SWbemDateTime object to convert CIM DATETIME values to and from either the FILETIME format or the VT_DATE format, see WMI Tasks: Dates and Times. For a description of the CIM DATETIME format, see Date and Time Format.

Requirements

Requirement Value
Minimum supported client
Windows Vista
Minimum supported server
Windows Server 2008
Header
Wbemdisp.h
Type library
Wbemdisp.tlb
DLL
Wbemdisp.dll
CLSID
CLSID_SWbemDateTime
IID
IID_ISWbemDateTime

See also

SWbemDateTime.SetFileTime

SWbemDateTime

DATETIME