The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

WBEMTime::operator-(const WBEMTime&) method

[The WBEMTime class is part of the WMI Provider Framework which is now considered in final state, and no further development, enhancements, or updates will be available for non-security related issues affecting these libraries. The MI APIs should be used for all new development.]

This overload of the WBEMTime class subtraction operator (–) subtracts a time from the object's time to produce a new time span object that contains the difference between the two times.


WBEMTime operator-(
  [ref] const WBEMTime &subtractTime


subtractTime [ref]

Reference to the WBEMTime object, whose time is subtracted from the "this" object.

Return value

When a WBEMTime object is returned, it is a new object whose time is the difference between the "this" object and the WBEMTimeSpan object used as the argument.

When a WBEMTimeSpan object is returned, it is a new time span object whose value is the difference between the "this" object and the WBEMTime object used as an argument.

Any returned objects that has a negative time span or a time before Jan 1, 1601 are set to INVALID_TIME.


Minimum supported client

Windows Vista

Minimum supported server

Windows Server 2008