A class to represent time instant.
More...
#include <TimeInstant.h>
A class to represent time instant.
A time instant is a point on the continuous time axis. It is composed of a date that uses the Gregorian calendar and of a local time. Internally, it uses the datetime boost library to represent time instant, by using the data type boost::posix_time::ptime.
- See also
- Date, DateTime, TimeInstantTZ, TimeDuration, TimePeriod, TimePeriodTZ, DatePeriod, DateDuration
Definition at line 55 of file TimeInstant.h.
◆ TimeInstant() [1/4]
te::dt::TimeInstant::TimeInstant |
( |
| ) |
|
◆ TimeInstant() [2/4]
Constructor from a date and time offset.
- Parameters
-
d | The date. |
td | Time offset. |
◆ TimeInstant() [3/4]
te::dt::TimeInstant::TimeInstant |
( |
const boost::posix_time::ptime & |
t | ) |
|
◆ TimeInstant() [4/4]
te::dt::TimeInstant::TimeInstant |
( |
const std::string & |
dtime | ) |
|
Constructor.
It constructs a time instant from a non delimited ISO form string. Example: 20020131T235959
- Parameters
-
◆ ~TimeInstant()
virtual te::dt::TimeInstant::~TimeInstant |
( |
| ) |
|
|
virtual |
Constructor.
Returns an instance of this class initialized with the current date time
◆ clone()
◆ getDate()
Date te::dt::TimeInstant::getDate |
( |
| ) |
const |
|
inline |
It returns the date associated to time instant.
- Returns
- The date
Definition at line 106 of file TimeInstant.h.
◆ getDateTimeType()
◆ getTime()
It returns the time duration associated to time instant.
- Returns
- The time duration
◆ getTimeInstant() [1/2]
boost::posix_time::ptime & te::dt::TimeInstant::getTimeInstant |
( |
| ) |
|
|
inline |
It returns the boost time instant type.
- Returns
- The boost time instant type.
Definition at line 99 of file TimeInstant.h.
◆ getTimeInstant() [2/2]
const boost::posix_time::ptime & te::dt::TimeInstant::getTimeInstant |
( |
| ) |
const |
|
inline |
It returns the boost time instant type.
- Returns
- The boost time instant type.
Definition at line 92 of file TimeInstant.h.
◆ 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.
◆ now()
◆ operator!=()
bool te::dt::TimeInstant::operator!= |
( |
const DateTime & |
rhs | ) |
const |
|
virtual |
Operator !=.
- Parameters
-
rhs | The time instant to be compared. |
- Returns
- It returns true if the two time instants are not equal. Otherwise, it returns false.
Implements te::dt::DateTime.
◆ operator-()
long te::dt::TimeInstant::operator- |
( |
const TimeInstant & |
rhs | ) |
const |
Operator -.
- Parameters
-
rhs | The right-hand-side time instant. |
- Returns
- It returns the number of seconds between the two time instants.
◆ operator<()
bool te::dt::TimeInstant::operator< |
( |
const DateTime & |
rhs | ) |
const |
|
virtual |
Operator <.
- Parameters
-
rhs | The right-hand-side time instant to be compared. |
- Returns
- It returns true if the right-hand-side time instant is greater than the lefth side one. Otherwise, it returns false.
Implements te::dt::DateTime.
◆ operator==()
bool te::dt::TimeInstant::operator== |
( |
const DateTime & |
rhs | ) |
const |
|
virtual |
Operator ==.
- Parameters
-
rhs | The time instant to be compared. |
- Returns
- It returns true if the two time instants are equal. Otherwise, it returns false.
Implements te::dt::DateTime.
◆ operator>()
bool te::dt::TimeInstant::operator> |
( |
const DateTime & |
rhs | ) |
const |
|
virtual |
Operator >
- Parameters
-
rhs | The right-hand-side time instant to be compared. |
- Returns
- It returns true if the right-hand-side time instant is less than the lefth side one. Otherwise, it returns false.
Implements te::dt::DateTime.
◆ toString()
std::string te::dt::TimeInstant::toString |
( |
| ) |
const |
|
virtual |
It returns the time instant in the ISO textual format (YYYYMMDDTHHMMSS,fffffffff) where T is the date-time separator.
- Returns
- The time instant in the ISO textual format (YYYYMMDDTHHMMSS,fffffffff) where T is the date-time separator.
Implements te::dt::AbstractData.
◆ m_timeInstant
boost::posix_time::ptime te::dt::TimeInstant::m_timeInstant |
|
protected |
The internal time instant information.
Definition at line 189 of file TimeInstant.h.
The documentation for this class was generated from the following file:
- /home/castejon/castejon_files/develop/terralib5/git_release/src/terralib/datatype/TimeInstant.h