Поделиться через


CTime Comparison Operators

Comparison operators.

bool operator ==(
   CTime time 
) const throw( );
bool operator !=(
   CTime time 
) const throw( );
bool operator <(
   CTime time 
) const throw( );
bool operator >(
   CTime time 
) const throw( );
bool operator <=(
   CTime time 
) const throw( );
bool operator >=(
   CTime time 
) const throw( );

Parameters

  • time
    The CTime object to be compared.

Return Value

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
ATLASSERT(t1 != t2);
ATLASSERT(t1 < t2);
ATLASSERT(t1 <= t2);   

Requirements

Header: atltime.h

See Also

Reference

CTime Class

Hierarchy Chart

Other Resources

CTime Members