Share via


CTimeSpan::GetDays

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

LONGLONG GetDays( ) const throw( );

Return Value

Returns the number of complete 24-hour days in the time span. This value may be negative if the time span is negative.

Remarks

Note that Daylight Savings Time can cause GetDays to return a potentially surprising result. For example, when DST is in effect, GetDays reports the number of days between April 1 and May 1 as 29, not 30, because one day in April is shortened by an hour and therefore does not count as a complete day.

Example

CTimeSpan ts(3, 1, 5, 12); // 3 days, 1 hour, 5 min, and 12 sec
ATLASSERT(ts.GetDays() == 3);   

Requirements

Header: atltime.h

See Also

Reference

CTimeSpan Class

Hierarchy Chart