Delen via


CTime::operator +=, -=

These operators add and subtract a CTimeSpan object to and from this CTime object.

CTime& operator +=( 
   CTimeSpan span  
) throw( ); 
CTime& operator -=( 
   CTimeSpan span  
) throw( );

Parameters

  • span
    The CTimeSpan object to be added or subtracted.

Return Value

The updated CTime object.

Remarks

These operators allow you to add and subtract a CTimeSpan object to and from this CTime object.

Example

CTime t(1999, 3, 19, 22, 15, 0); // 10:15 PM March 19, 1999
t += CTimeSpan(0, 1, 0, 0);      // 1 hour exactly
ATLASSERT(t.GetHour() == 23);   

Requirements

Header: atltime.h

See Also

Reference

CTime Class

Hierarchy Chart