COleDateTime::GetStatus

DateTimeStatus GetStatus( ) const;

Return Value

Returns the status of this COleDateTime value.

Remarks

Call this member function to get the status (validity) of a given COleDateTime object.

The return value is defined by the DateTimeStatus enumerated type, which is defined within the COleDateTime class.

enum DateTimeStatus{
   valid = 0,
   invalid = 1,
   null = 2,
};

For a brief description of these status values, see the following list:

The status of a COleDateTime object is invalid in the following cases:

For more information about the operations that may set the status to invalid, see the following member functions:

For more information about the bounds for COleDateTime values, see the article Date and Time: Automation Support in Visual C++ Programmer’s Guide.

Example

COleDateTime t;

// this one is a leap year
t.SetDateTime(2000, 2, 29, 5, 0, 0);
ASSERT(t.GetStatus() == COleDateTime::valid);

// this date isn't valid
t.SetDateTime(1925, 2, 30, 5, 0, 0);
ASSERT(t.GetStatus() == COleDateTime::invalid);

// the only way to set null is to set null!
t.SetStatus(COleDateTime::null);
ASSERT(t.GetStatus() == COleDateTime::null);

COleDateTime OverviewClass MembersHierarchy Chart

See Also   COleDateTime::SetStatus, COleDateTime::m_status