Compartilhar via


COleDateTimeSpan Class

Represents a relative time, a time span.

class COleDateTimeSpan

Members

Public Constructors

Name

Description

COleDateTimeSpan::COleDateTimeSpan

Constructs a COleDateTimeSpan object.

Public Methods

Name

Description

COleDateTimeSpan::Format

Generates a formatted string representation of a COleDateTimeSpan object.

COleDateTimeSpan::GetDays

Returns the day portion of the span this COleDateTimeSpan object represents.

COleDateTimeSpan::GetHours

Returns the hour portion of the span this COleDateTimeSpan object represents.

COleDateTimeSpan::GetMinutes

Returns the minute portion of the span this COleDateTimeSpan object represents.

COleDateTimeSpan::GetSeconds

Returns the second portion of the span this COleDateTimeSpan object represents.

COleDateTimeSpan::GetStatus

Gets the status (validity) of this COleDateTimeSpan object.

COleDateTimeSpan::GetTotalDays

Returns the number of days this COleDateTimeSpan object represents.

COleDateTimeSpan::GetTotalHours

Returns the number of hours this COleDateTimeSpan object represents.

COleDateTimeSpan::GetTotalMinutes

Returns the number of minutes this COleDateTimeSpan object represents.

COleDateTimeSpan::GetTotalSeconds

Returns the number of seconds this COleDateTimeSpan object represents.

COleDateTimeSpan::SetDateTimeSpan

Sets the value of this COleDateTimeSpan object.

COleDateTimeSpan::SetStatus

Sets the status (validity) of this COleDateTimeSpan object.

Public Operators

operator +, -

Add, subtract, and change sign for COleDateTimeSpan values.

operator +=, -=

Add and subtract a COleDateTimeSpan value from this COleDateTimeSpan value.

operator =

Copies a COleDateTimeSpan value.

operator ==, <, <=

Compare two COleDateTimeSpan values.

operator double

Converts this COleDateTimeSpan value to a double.

Public Data Members

Name

Description

COleDateTimeSpan::m_span

Contains the underlying double for this COleDateTimeSpan object.

COleDateTimeSpan::m_status

Contains the status of this COleDateTimeSpan object.

Remarks

COleDateTimeSpan does not have a base class.

A COleDateTimeSpan keeps time in days.

COleDateTimeSpan is used with its companion class COleDateTime. COleDateTime encapsulates the DATE data type of OLE automation. COleDateTime represents absolute time values. All COleDateTime calculations involve COleDateTimeSpan values. The relation between these classes is analogous to the one between CTime and CTimeSpan.

For more information on the COleDateTime and COleDateTimeSpan classes, see the article Date and Time: Automation Support.

Requirements

Header: ATLComTime.h

See Also

Reference

COleDateTime Class

CTime Class

CTimeSpan Class

Hierarchy Chart

Other Resources

ATL/MFC Shared Classes