Sets the date and time of this COleDateTime object.
- nYear, nMonth, nDay, nHour, nMin, nSec
Indicate the date and time components to be copied into this COleDateTime object.
Zero if the value of this COleDateTime object was set successfully; otherwise, 1. This return value is based on the DateTimeStatus enumerated type. For more information, see the SetStatus member function.
See the following table for bounds for the parameter values:
100 – 9999
1 – 12
0 – 31
0 – 23
0 – 59
0 – 59
If the day of the month overflows, it is converted to the correct day of the next month and the month and/or year is incremented accordingly. A day value of zero indicates the last day of the previous month. The behavior is the same as d9d69521-9b33-4fc5-8a1c-929f216db450.
If the date or time value specified by the parameters is not valid, the status of this object is set to invalid and the value of this object is not changed.
Here are some examples of time values:
Here are some examples of date values:
15 April 1995
17 July 1789
For information on member functions that query the value of this COleDateTime object, see the following member functions:
For more information about the bounds for COleDateTime values, see the article Date and Time: Automation Support.
See the example for GetStatus.