Windows Dev Center

SWbemDateTime.GetFileTime method

The GetFileTime method of the SWbemDateTime object converts a date and time value in the CIM DATETIME format to the FILETIME format.

If the parameter is set to TRUE, then the return value represents a local time for the client. Otherwise, the return value is a Coordinated Universal Time (UTC) time. A FILETIME DATETIME structure is a 64-bit value 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 an explanation of this syntax, see Document Conventions for the Scripting API.


vDate = .GetFileTime( _
  [ ByVal bIsLocaL ] _


bIsLocaL [in, optional]

Indicates whether the returned value is interpreted as local time. The UTC property then contains the local time converted to the correct Coordinated Universal Times (UTC) offset. If the value is FALSE, then the value is interpreted as UTC with a zero (0) offset.

Return value

The date and time in the FILETIME format.

Error codes

After completing the GetFileTime method, the Err object may contain the error code in the following table.

Error (Name/Dec/Hex)Meaning
2147749889 (0x80041001)

The call failed.


VT_DATE and FILETIME values cannot contain wildcard fields.

The GetFileTime method fails (wbemErrFailed) if any of the following properties are FALSE:

On a successful return from SetFileTime, all of these properties are set to TRUE.


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.


Minimum supported client

Windows Vista

Minimum supported server

Windows Server 2003

Type library




See also




© 2015 Microsoft