Provide formatted timestamp strings.
More...
#include <boost/date_time.hpp>
Go to the source code of this file.
|
typedef boost::posix_time::ptime | Timestamp::Time |
| Data structure to jold time and date information.
|
|
typedef boost::posix_time::time_duration | Timestamp::Duration |
|
Provide formatted timestamp strings.
- Author
- Finn Lasse Buessen
- Copyright
- Copyright (c) 2020
◆ isOlder()
bool Timestamp::isOlder |
( |
const Time & |
time, |
|
|
const int |
offset |
|
) |
| |
|
inline |
Check whether the time object is older than a given number of seconds.
- Parameters
-
time | Time object. |
offset | Age threshold in seconds. |
- Returns
- bool Return true if the time object is older than the specified amount of seconds. Otherwise, return false.
◆ time() [1/3]
Get the current time.
- Returns
- Time Current time.
◆ time() [2/3]
Time Timestamp::time |
( |
const int |
offset | ) |
|
|
inline |
Get the current time plus some offset into the furutre.
- Parameters
-
offset | Offset duration in seconds. |
- Returns
- Time Current time plus offset.
◆ time() [3/3]
Time Timestamp::time |
( |
const std::string & |
timestamp | ) |
|
|
inline |
Get a time object from a formatted timestamp string.
- Parameters
-
timestamp | Formatted timestamp string. |
- Returns
- Time Time as described by the timestamp.
◆ timestamp() [1/2]
std::string Timestamp::timestamp |
( |
| ) |
|
|
inline |
Retrieve a timestamp string for the current time.
- Returns
- std::string Timestamp string.
◆ timestamp() [2/2]
std::string Timestamp::timestamp |
( |
const Time & |
time | ) |
|
|
inline |
Retrieve a timestamp string for the specified time.
- Parameters
-
- Returns
- std::string Timestamp string.