Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
COleDateTimeSpan( );
COleDateTimeSpan( const COleDateTimeSpan& dateSpanSrc );
COleDateTimeSpan( double dblSpanSrc );
COleDateTimeSpan( long lDays**, int** nHours**, int** nMins**, int** nSecs );
Parameters
dateSpanSrc
An existing COleDateTimeSpan object to be copied into the new COleDateTimeSpan object.
dblSpanSrc
The number of days to be copied into the new COleDateTimeSpan object.
lDays, nHours, nMins, nSecs
Indicate the day and time values to be copied into the new COleDateTimeSpan object.
Remarks
All of these constructors create new COleDateTimeSpan objects initialized to the specified value. A brief description of each of these constructors follows:
COleDateTimeSpan() Constructs a COleDateTimeSpan object initialized to 0.
**COleDateTimeSpan(**dateSpanSrc ) Constructs a COleDateTimeSpan object from an existing COleDateTimeSpan object.
**COleDateTimeSpan(**dblSpanSrc ) Constructs a COleDateTimeSpan object from a floating-point value.
COleDateTimeSpan(lDays, nHours**,** nMins**,** nSecs**)** Constructs a COleDateTimeSpan object initialized to the specified numerical values.
The status of the new COleDateTimeSpan object is set to valid.
For more information about the bounds for COleDateTimeSpan values, see the article in Visual C++ Programmer’s Guide.
Example
COleDateTimeSpan spanOne( 2.75 ); // 2 days and 18 hours
COleDateTimeSpan spanTwo( 2, 18, 0, 0 ); // 2 days and 18 hours
COleDateTimeSpan spanThree( 3, -6, 0, 0 ); // 2 days and 18 hours
COleDateTimeSpan ts1; // Uninitialized time value
COleDateTimeSpan ts2a(ts1); // Copy constructor
COleDateTimeSpan ts2b = ts1; // Copy constructor again
COleDateTimeSpan ts3(100.0); // 100 days
COleDateTimeSpan ts4(0, 1, 5, 12); // 1 hour, 5 minutes, and 12 seconds
COleDateTimeSpan Overview | Class Members | Hierarchy Chart
See Also COleDateTimeSpan::operator =, COleDateTimeSpan::GetStatus, COleDateTimeSpan::m_span, COleDateTimeSpan::m_status