Export (0) Print
Expand All

CTimeSpan Class

An amount of time, which is internally stored as the number of seconds in the time span.

class CTimeSpan

Name

Description

CTimeSpan::CTimeSpan

Constructs CTimeSpan objects in various ways.

Name

Description

CTimeSpan::Format

Converts a CTimeSpan into a formatted string.

CTimeSpan::GetDays

Returns a value that represents the number of complete days in this CTimeSpan.

CTimeSpan::GetHours

Returns a value that represents the number of hours in the current day (–23 through 23).

CTimeSpan::GetMinutes

Returns a value that represents the number of minutes in the current hour (–59 through 59).

CTimeSpan::GetSeconds

Returns a value that represents the number of seconds in the current minute (–59 through 59).

CTimeSpan::GetTimeSpan

Returns the value of the CTimeSpan object.

CTimeSpan::GetTotalHours

Returns a value that represents the total number of complete hours in this CTimeSpan.

CTimeSpan::GetTotalMinutes

Returns a value that represents the total number of complete minutes in this CTimeSpan.

CTimeSpan::GetTotalSeconds

Returns a value that represents the total number of complete seconds in this CTimeSpan.

CTimeSpan::Serialize64

Serializes data to or from an archive.

operator + –

Adds and subtracts CTimeSpan objects.

operator += –=

Adds and subtracts a CTimeSpan object to and from this CTimeSpan.

operator == < etc.

Compares two relative time values.

CTimeSpan does not have a base class.

CTimeSpan functions convert seconds to various combinations of days, hours, minutes, and seconds.

The CTimeSpan object is stored in a __time64_t structure, which is 8 bytes.

A companion class, CTime, represents an absolute time.

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 8 bytes. Most member functions are inline.

For more information on using CTimeSpan, see the articles Date and Time, and Time Management in the Run-Time Library Reference.

Header: atltime.h

Show:
© 2014 Microsoft