A base class for date data types.
More...
#include <Date.h>
A base class for date data types.
A class to represent dates based on the Gregorian Calendar. Internally, it uses boost datetime library to represent gregorian date, by using the data type boost::gregorian::date. For more information see the date representation defined in ISO 8601:2004 specification.
- See also
- DateTime, DateDuration, DatePeriod, TimeDuration, TimeInstant, TimeInstantTZ, TimePeriod, TimePeriodTZ
Definition at line 53 of file Date.h.
te::dt::Date::Date |
( |
boost::gregorian::greg_year |
year, |
|
|
boost::gregorian::greg_month |
month, |
|
|
boost::gregorian::greg_day |
day |
|
) |
| |
Constructor.
- Parameters
-
year | A gregorian year in the range: [1400, 9999]. |
month | A gregorian month in the range: [1, 12]. |
day | A gregorian day in the range: [1,31]. |
te::dt::Date::Date |
( |
const boost::gregorian::date & |
d | ) |
|
Constructor.
- Parameters
-
d | A date based on the Gregorian Calendar. |
virtual te::dt::Date::~Date |
( |
| ) |
|
|
virtual |
const boost::gregorian::date& te::dt::Date::getDate |
( |
| ) |
const |
|
inline |
It returns the internal boost date type.
- Returns
- The internal boost date type.
Definition at line 83 of file Date.h.
boost::gregorian::date& te::dt::Date::getDate |
( |
| ) |
|
|
inline |
It returns the internal boost date type.
- Returns
- The internal boost date type.
Definition at line 90 of file Date.h.
It returns the subtype of the date and time type.
- Returns
- The subtype of the date and time type.
Implements te::dt::DateTime.
Definition at line 179 of file Date.h.
References te::dt::DATE.
boost::gregorian::greg_day te::dt::Date::getDay |
( |
| ) |
const |
|
inline |
It returns the gregorian day - from 1 to 31.
- Returns
- The gregorian day.
Definition at line 97 of file Date.h.
boost::gregorian::greg_month te::dt::Date::getMonth |
( |
| ) |
const |
|
inline |
It returns the gregorian month - from 1 to 12.
- Returns
- The gregorian month.
Definition at line 104 of file Date.h.
int te::dt::DateTime::getTypeCode |
( |
| ) |
const |
|
inlinevirtualinherited |
It returns the data type code associated to date and time values: DATETIME_TYPE.
- Returns
- The data type code associated to the date and time values: DATETIME_TYPE.
Implements te::dt::AbstractData.
Definition at line 103 of file DateTime.h.
References te::dt::DATETIME_TYPE.
boost::gregorian::greg_year te::dt::Date::getYear |
( |
| ) |
const |
|
inline |
It returns the gregorian year.
- Returns
- The gregorian year.
Definition at line 111 of file Date.h.
bool te::dt::Date::operator!= |
( |
const DateTime & |
rhs | ) |
const |
|
virtual |
Operator !=.
- Parameters
-
rhs | The date to be compared. |
- Returns
- It returns true if the two dates are not equal. Otherwise, it returns false.
Implements te::dt::DateTime.
long te::dt::Date::operator- |
( |
const Date & |
rhs | ) |
const |
Operator -.
- Parameters
-
rhs | The right side datetime. |
- Returns
- It returns the number of the days between two dates.
bool te::dt::Date::operator< |
( |
const DateTime & |
rhs | ) |
const |
|
virtual |
Operator <.
- Parameters
-
rhs | The right side date to be compared. |
- Returns
- It returns true if the right side date is greater than the lefth side one. Otherwise, it returns false.
Implements te::dt::DateTime.
bool te::dt::Date::operator== |
( |
const DateTime & |
rhs | ) |
const |
|
virtual |
Operator ==.
- Parameters
-
rhs | The date to be compared. |
- Returns
- It returns true if the two dates are equal. Otherwise, it returns false.
Implements te::dt::DateTime.
bool te::dt::Date::operator> |
( |
const DateTime & |
rhs | ) |
const |
|
virtual |
Operator >
- Parameters
-
rhs | The right side date to be compared. |
- Returns
- It returns true if the right side date is less than the lefth side one. Otherwise, it returns false.
Implements te::dt::DateTime.
std::string te::dt::Date::toString |
( |
| ) |
const |
|
virtual |
It returns the date in the ISO textual format (YYYYMMDD).
- Returns
- The date in the ISO textual format (YYYYMMDD).
Implements te::dt::AbstractData.
boost::gregorian::date te::dt::Date::m_date |
|
protected |
Internal date information.
Definition at line 188 of file Date.h.
The documentation for this class was generated from the following file:
- /home/castejon/castejon_files/develop/terralib5/git_master/terralib5/src/terralib/datatype/Date.h