|
Original Symbian headers
Selected EUSER, Window Server, networking, graphics and device declarations
|
A date and time object in which the individual components are accessible in human-readable form. More...
#include <e32std.h>
Public Member Functions | |
| TDateTime () | |
| Constructs an uninitialised TDateTime object. | |
| IMPORT_C | TDateTime (TInt aYear, TMonth aMonth, TInt aDay, TInt aHour, TInt aMinute, TInt aSecond, TInt aMicroSecond) |
| Constructs the TDateTime object with the seven fields which comprise a date and time. | |
| IMPORT_C TInt | Set (TInt aYear, TMonth aMonth, TInt aDay, TInt aHour, TInt aMinute, TInt aSecond, TInt aMicroSecond) |
| Sets all date and time components. | |
| IMPORT_C TInt | SetYear (TInt aYear) |
| Sets the year without a leap year check. | |
| IMPORT_C TInt | SetYearLeapCheck (TInt aYear) |
| Sets the year with a leap year check. | |
| IMPORT_C TInt | SetMonth (TMonth aMonth) |
| Sets the month component of the date/time. | |
| IMPORT_C TInt | SetDay (TInt aDay) |
| Sets the day component of the date/time. | |
| IMPORT_C TInt | SetHour (TInt aHour) |
| Sets the hour component of the date/time. | |
| IMPORT_C TInt | SetMinute (TInt aMinute) |
| Sets the minute component of the date/time. | |
| IMPORT_C TInt | SetSecond (TInt aSecond) |
| Sets the second component of the date/time. | |
| IMPORT_C TInt | SetMicroSecond (TInt aMicroSecond) |
| Sets the microsecond component of the date/time. | |
| TInt | Year () const |
| Gets the year component of the date/time. | |
| TMonth | Month () const |
| Gets the month component of the date/time. | |
| TInt | Day () const |
| Gets the day component of the date/time. | |
| TInt | Hour () const |
| Gets the hour component of the date/time. | |
| TInt | Minute () const |
| Gets the minute component of the date/time. | |
| TInt | Second () const |
| Gets the second component of the date/time. | |
| TInt | MicroSecond () const |
| Gets the microsecond component of the date/time. | |
A date and time object in which the individual components are accessible in human-readable form.
The individual components are: year, month, day, hour, minute, second and microsecond.
These components are stored as integers and all except the year are checked for validity when a TDateTime is constructed or assigned new values.
This class only supports getting and setting the entire date/time or any component of it. It does not support adding or subtracting intervals to or from a time. For functions which manipulate times, use class TTime.
|
inline |
Constructs an uninitialised TDateTime object.
(generated from Symbian Developer Library)
| IMPORT_C TDateTime::TDateTime | ( | TInt | aYear, |
| TMonth | aMonth, | ||
| TInt | aDay, | ||
| TInt | aHour, | ||
| TInt | aMinute, | ||
| TInt | aSecond, | ||
| TInt | aMicroSecond | ||
| ) |
Constructs the TDateTime object with the seven fields which comprise a date and time.
| aYear | The year. No check is made for validity. |
| aMonth | The month. Range is EJanuary to EDecember. |
| aDay | The day. Range is zero to number of days in month minus one. |
| aHour | The hour. Range is 0 to 23. |
| aMinute | The minute. Range is 0 to 59. |
| aSecond | The second. Range is 0 to 59 |
| aMicroSecond | The microsecond. Range is 0 to 999999 |
Panic condition: USER 3, if an attempt is made to set an invalid value for any of the fields, except for the year. No check is made upon the validity of the year.
(generated from Symbian Developer Library)
|
inline |
Gets the day component of the date/time.
(generated from Symbian Developer Library)
|
inline |
Gets the hour component of the date/time.
(generated from Symbian Developer Library)
|
inline |
Gets the microsecond component of the date/time.
(generated from Symbian Developer Library)
|
inline |
Gets the minute component of the date/time.
(generated from Symbian Developer Library)
|
inline |
Gets the month component of the date/time.
(generated from Symbian Developer Library)
|
inline |
Gets the second component of the date/time.
(generated from Symbian Developer Library)
| IMPORT_C TInt TDateTime::Set | ( | TInt | aYear, |
| TMonth | aMonth, | ||
| TInt | aDay, | ||
| TInt | aHour, | ||
| TInt | aMinute, | ||
| TInt | aSecond, | ||
| TInt | aMicroSecond | ||
| ) |
Sets all date and time components.
Note:
| aYear | Year. No check is made on its validity, except that if the date is set to February 29th, the year can only be set to a leap year, otherwise an error is returned. |
| aMonth | Month. The valid range is EJanuary to EDecember. If an attempt is made to set an invalid month, or if the current day number in the month is greater than or equal to the number of days in the new month, an error is returned. |
| aDay | The number of the day within the month, offset from zero. If greater than or equal to the total number of days in the month,an error is returned. |
| aHour | Hour. Range is 0 to 23. |
| aMinute | Minute. Range is 0 to 59. |
| aSecond | Second. Range is 0 to 59. |
| aMicroSecond | Microsecond. Range is 0 to 999999. |
(generated from Symbian Developer Library)
| IMPORT_C TInt TDateTime::SetDay | ( | TInt | aDay | ) |
Sets the day component of the date/time.
| aDay | The number of the day within the month, offset from zero. If equal to or greater than the total number of days in the month, an error is returned. |
(generated from Symbian Developer Library)
| IMPORT_C TInt TDateTime::SetHour | ( | TInt | aHour | ) |
Sets the hour component of the date/time.
| aHour | The hour. Range is 0 to 23. |
(generated from Symbian Developer Library)
| IMPORT_C TInt TDateTime::SetMicroSecond | ( | TInt | aMicroSecond | ) |
Sets the microsecond component of the date/time.
| aMicroSecond | The microsecond. Range is 0 to 999999. |
(generated from Symbian Developer Library)
| IMPORT_C TInt TDateTime::SetMinute | ( | TInt | aMinute | ) |
Sets the minute component of the date/time.
| aMinute | The minute. Range is 0 to 59. |
(generated from Symbian Developer Library)
| IMPORT_C TInt TDateTime::SetMonth | ( | TMonth | aMonth | ) |
Sets the month component of the date/time.
| aMonth | The month to be set. The range is from EJanuary to EDecember. If an attempt is made to set an invalid month, or if the current day number in the month is greater than or equal to the number of days in the new month, an error is returned. |
(generated from Symbian Developer Library)
| IMPORT_C TInt TDateTime::SetSecond | ( | TInt | aSecond | ) |
Sets the second component of the date/time.
| aSecond | The second. Range is 0 to 59. |
(generated from Symbian Developer Library)
| IMPORT_C TInt TDateTime::SetYear | ( | TInt | aYear | ) |
Sets the year without a leap year check.
No check is made on the validity of the year except that if the current date is February 29th, the year can only be changed to another leap year, otherwise an error is returned.
| aYear | The year. |
(generated from Symbian Developer Library)
| IMPORT_C TInt TDateTime::SetYearLeapCheck | ( | TInt | aYear | ) |
Sets the year with a leap year check.
Unlike SetYear(), if the date is the 29th February, this function allows the year to be set to a non-leap year. In this case, the date is reset to the 28th February.
| aYear | The year. |
(generated from Symbian Developer Library)
|
inline |
Gets the year component of the date/time.
A negative value indicates a BC date.
(generated from Symbian Developer Library)