CTime Comparison Operators

Syntax

BOOL operator ==( CTime time ) const;

BOOL operator !=( CTime time ) const;

BOOL operator <( CTime time ) const;

BOOL operator >( CTime time ) const;

BOOL operator <=( CTime time ) const;

BOOL operator >=( CTime time ) const;

Remarks

These operators compare two absolute times and return TRUE if the condition is true; otherwise FALSE.

Example

CTime t1 = CTime::GetCurrentTime();

CTime t2 = t1 + CTimeSpan( 0, 1, 0, 0 ); // 1 hour later

ASSERT( t1 != t2 );

ASSERT( t1 < t2 );

ASSERT( t1 <= t2 );