Share via


COleDateTime::operator +=, -=

Add and subtract a ColeDateTime value from this COleDateTime object.

COleDateTime& operator +=(
   COleDateTimeSpan dateSpan 
) throw( );
COleDateTime& operator -=(
   COleDateTimeSpan dateSpan 
) throw( );

Remarks

These operators allow you to add and subtract a COleDateTimeSpan value to and from this COleDateTime. If either of the operands is null, the status of the resulting COleDateTime value is null.

If the resulting COleDateTime value falls outside the bounds of acceptable values, the status of this COleDateTime value is set to invalid.

If either of the operands is invalid and other is not null, the status of the resulting COleDateTime value is invalid.

For more information on the valid, invalid, and null status values, see the m_status member variable.

The += and -= operators will assert if the COleDateTime object is set to null. See COleDateTime Relational Operators for an example.

For more information about the bounds for COleDateTime values, see the article Date and Time: Automation Support.

Requirements

Header: atlcomtime.h

See Also

Reference

COleDateTime Class

Hierarchy Chart

COleDateTime::operator +, -

COleDateTime::GetStatus

Other Resources

COleDateTime Members