Upravit

Sdílet prostřednictvím


SWbemDateTime.SetFileTime method

The SetFileTime method of the SWbemDateTime object converts a date in the string FILETIME format to the CIM datetime format.

The FILETIME format is a 64-bit datetime structure that represents the number of 100-nanosecond units since the beginning of January 1, 1601. Windows Management Instrumentation (WMI) treats FILETIME values as string representations of unsigned 64-bit numbers.

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

Syntax

SWbemDateTime.SetFileTime( _
  ByVal strFileTime, _
  [ ByVal bIsLocal ] _
)

Parameters

strFileTime [in]

FILETIME value used to set the object.

bIsLocal [in, optional]

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

Return value

This method does not return a value.

Error codes

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

wbemErrInvalidSyntax - 2147749921 (0x80041021)

The format of strFileTime is not valid.

Remarks

After a successful call to SetFileTime, the datetime value is always interpreted as an absolute (datetime) value, and IsInterval is set to FALSE.

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.SetVarDate

SWbemDateTime

DATETIME