CTimeSpan

CTimeSpan does not have a base class.

A CTimeSpan object represents a relative time span. The CTimeSpan class incorporates the ANSI time_t data type and its associated run-time functions. These functions convert seconds to various combinations of days, hours, minutes, and seconds.

A CTimeSpan object keeps time in seconds. Because the CTimeSpan object is stored as a signed number in 4 bytes, the maximum allowed span is approximately ± 68 years.

A companion class, CTime, represents an absolute time. A CTimeSpan is the difference between two CTime values.

The CTime and CTimeSpan classes are not designed for derivation. Because there are no virtual functions, the size of both CTime and CTimeSpan objects is exactly 4 bytes. Most member functions are inline.

For more information on using CTimeSpan, see the article Date and Time in Visual C++ Programmer’s Guide and Time Management in the Run-Time Library Reference.

#include <afx.h>

Class MembersHierarchy Chart

See Also   Run-time functions: asctime, _ftime, gmtime, localtime, strftime, time