#include <Date.h>
Public Methods | |
Date (const char *s) throw (InvalidDate) | |
Constructor from character string. More... | |
Date () throw () | |
Constructor for invalid date. More... | |
unsigned | day () const throw (InvalidDate) |
Numerical day in month. More... | |
unsigned | month () const throw (InvalidDate) |
Numerical month in year. More... | |
unsigned | year () const throw (InvalidDate) |
Numerical year. More... | |
string | asString (unsigned format) const throw (InvalidDate) |
Get date as string. More... | |
unsigned long | asBCD () const throw (InvalidDate) |
Get date as binary-coded decimal. More... |
Definition at line 49 of file Date.h.
|
Constructor from character string. MySQL retrieves and displays DATE values in 'YYYY-MM-DD' format. The supported range is '1000-01-01' to '9999-12-31'.
|
|
Constructor for invalid date.
Definition at line 67 of file Date.h. 00067 { _year = _month = _day = 0; } 00068 |
|
Get date as binary-coded decimal. Format such as: 19640411 |
|
Get date as string. The format depends on the flag, as shown:
|
|
Numerical day in month.
Definition at line 72 of file Date.h. 00073 { 00074 if (_day == 0 || _day > 31) 00075 throw InvalidDate(); 00076 return _day; 00077 |
|
Numerical month in year.
Definition at line 82 of file Date.h. 00083 { 00084 if (_month == 0 || _month > 12) 00085 throw InvalidDate(); 00086 return _month; 00087 |
|
Numerical year.
Definition at line 92 of file Date.h. 00093 { 00094 if (_year < 1000 | _year > 9999) 00095 throw InvalidDate(); 00096 return _year; 00097 |