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 65 of file Date.h.
◆ Date() [1/4]
◆ Date() [2/4]
te::dt::Date::Date |
( |
const boost::gregorian::greg_year & |
year, |
|
|
const boost::gregorian::greg_month & |
month, |
|
|
const 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]. |
◆ Date() [3/4]
te::dt::Date::Date |
( |
const boost::gregorian::date & |
d | ) |
|
Constructor.
- Parameters
-
d | A date based on the Gregorian Calendar. |
◆ Date() [4/4]
◆ ~Date()
virtual te::dt::Date::~Date |
( |
| ) |
|
|
virtual |
◆ clone()
◆ getDate() [1/2]
boost::gregorian::date & te::dt::Date::getDate |
( |
| ) |
|
It returns the internal boost date type.
- Returns
- The internal boost date type.
◆ getDate() [2/2]
const boost::gregorian::date & te::dt::Date::getDate |
( |
| ) |
const |
◆ getDateTimeType()
It returns the subtype of the date and time type.
- Returns
- The subtype of the date and time type. Returns an instance of this class initialized with the current date time
Implements te::dt::DateTime.
Definition at line 205 of file Date.h.
References te::dt::DATE.
◆ getDay()
const boost::gregorian::greg_day & te::dt::Date::getDay |
( |
| ) |
const |
It returns the gregorian day - from 1 to 31.
- Returns
- The gregorian day.
◆ getMonth()
const boost::gregorian::greg_month & te::dt::Date::getMonth |
( |
| ) |
const |
It returns the gregorian month - from 1 to 12.
- Returns
- The gregorian month.
◆ getTypeCode()
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.
◆ getYear()
const boost::gregorian::greg_year & te::dt::Date::getYear |
( |
| ) |
const |
It returns the gregorian year.
- Returns
- The gregorian year.
◆ now()
static Date * te::dt::Date::now |
( |
| ) |
|
|
static |
◆ operator!=()
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.
◆ operator-()
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.
◆ operator<()
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.
◆ operator=()
Date & te::dt::Date::operator= |
( |
const Date & |
date | ) |
|
Operator =.
- Parameters
-
rhs | The date to be assigned. |
- Returns
- It returns the new value for the assigned object
◆ operator==()
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.
◆ operator>()
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.
◆ toString()
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.
◆ m_dateImpl
std::unique_ptr<DateImpl> te::dt::Date::m_dateImpl |
|
protected |
Internal date information.
Definition at line 217 of file Date.h.
The documentation for this class was generated from the following file:
- /home/castejon/castejon_files/develop/terralib5/git_release/src/terralib/datatype/Date.h