CTime operatore + ( CTimeSpan timeSpan ) const;
CTime operatore -( CTimeSpan timeSpan ) const;
CTimeSpan operatore -( CTime time ) const;
Osservazioni
Oggetti CTime rappresentano il tempo assoluto. CTimeSpan oggetti rappresentano tempo relativo. I primi due operatori consentono di aggiungere e sottrarre CTimeSpan oggetti da e verso oggetti CTime . Il terzo consente di sottrarre un oggetto CTime da un altro per ottenere un oggetto CTimeSpan.
Esempio
/ / esempio per CTime::operator +, -
CTime t1 (1999, 3, 19, 22, 15, 0); / / 22:15 19 Marzo 1999
CTime t2 (1999, 3, 20, 22, 15, 0); / / 22:15 20 Marzo 1999
CTimeSpan ts = t2 - t1; / / Sottrarre 2 CTimes
ASSERT (ts.GetTotalSeconds() = = 86400L);
ASSERT ((t1 + ts) = = t2); / / Aggiungi un CTimeSpan di un CTime.
ASSERT ((t2 - ts) = = t1); / / Sottrarre un CTimeSpan da un Ctime
CTime pa&noramica |nbsp; Membri della classe | Gerarchia Chart