Wrapper class for boost::posix_time::ptime for adding more functionality to it.
More...
#include <utils/Time.h>
|
typedef boost::posix_time::ptime | Base |
|
Wrapper class for boost::posix_time::ptime for adding more functionality to it.
If not stated otherwise the time represented by this class is in UTC time.
For more information on the underlying boost::posix_time classes refer to http://boost.org/doc/libs/1_44_0/doc/html/date_time/posix_time.html .
The underlying datatype in boost::posix_time::ptime is int64.
- Examples:
- tutorials/Point2Visualization.C, and tutorials/Point3Visualization.C.
◆ Base
typedef boost::posix_time::ptime Base |
◆ Time() [1/6]
Construct from date and timespan.
◆ Time() [2/6]
Construct from base class.
◆ Time() [3/6]
Construct a time at start of the given day (midnight)
◆ Time() [4/6]
Time |
( |
const Base::time_rep_type & |
rhs | ) |
|
|
inline |
Construct from time representation.
◆ Time() [5/6]
Time |
( |
const boost::posix_time::special_values |
sv | ) |
|
|
inline |
Construct from special value.
◆ Time() [6/6]
Default constructor constructs to not_a_date_time.
◆ reflectRead()
◆ reflectWrite()
void reflectWrite |
( |
Reflector & |
r | ) |
|
|
inline |
◆ now()
◆ invalid()
◆ unixEpoch()
static Time unixEpoch |
( |
| ) |
|
|
inlinestatic |
Returns the unix epoch 1.1.1970 0:0:0.000.
- Returns
- Unix epoch time.
◆ toUnixTimestamp()
uint32 toUnixTimestamp |
( |
| ) |
const |
|
inline |
Converts the current time to a unix timestamp in seconds.
- Returns
- timestamp in seconds.
◆ fromUnixTimestamp()
static Time fromUnixTimestamp |
( |
uint32 |
seconds | ) |
|
|
inlinestatic |
Creates a time representation out of a unix timestamp.
- Parameters
-
[in] | seconds | The unix timestamp in seconds. |
◆ toUnixNS()
uint64 toUnixNS |
( |
| ) |
const |
|
inline |
Converts the current time to a unix timestamp in nanoseconds.
- Returns
- timestamp in nanoseconds.
◆ fromUnixNS()
static Time fromUnixNS |
( |
uint64 |
nanoseconds | ) |
|
|
inlinestatic |
Creates a time representation out of a unix timestamp.
- Parameters
-
[in] | nanoseconds | The unix timestamp in nanoseconds. |
◆ toLocal()
Converts to local time zone based on the settings of the machine.
- Returns
- The time in local time zone.
◆ toTimeZone()
Time toTimeZone |
( |
const std::string & |
zone | ) |
|
|
inline |
Converts to given time zone.
- Parameters
-
[in] | zone | The time zone to convert to e.g. "CET+1" (= name CET, 1 hour ahead of GMT). |
- Returns
- The time in the requested time zone.
◆ isValid()
Returns true if this contains a valid time.
- Returns
- true if this is a valid time, false otherwise
◆ operator-() [1/3]
◆ operator+() [1/2]
◆ operator+=() [1/2]
◆ operator-() [2/3]
◆ operator-=() [1/2]
◆ operator+() [2/2]
◆ operator+=() [2/2]
◆ operator-() [3/3]
◆ operator-=() [2/2]
The documentation for this class was generated from the following file: