Class MHO_TimeStampConverter.
More...
#include <MHO_TimeStampConverter.hh>
Class MHO_TimeStampConverter.
- Date
- Mon May 11 15:51:26 2020 -0400
- Author
- J. Barrett - barre.nosp@m.ttj@.nosp@m.mit.e.nosp@m.du A class responsible for converting times/dates stored in a human readable string into Unix epoch seconds and fractions of a second. The conversion can be done in both directions
◆ MHO_TimeStampConverter()
hops::MHO_TimeStampConverter::MHO_TimeStampConverter |
( |
| ) |
|
|
inline |
◆ ~MHO_TimeStampConverter()
hops::MHO_TimeStampConverter::~MHO_TimeStampConverter |
( |
| ) |
|
|
inline |
◆ ConvertEpochSecondToTimeStamp()
bool hops::MHO_TimeStampConverter::ConvertEpochSecondToTimeStamp |
( |
const uint64_t & |
epoch_sec, |
|
|
const double & |
fractional_part, |
|
|
std::string & |
date_string |
|
) |
| |
|
static |
- convert a long int epoch second count to a human readable date string in YYYY-MM-DDTHH:MM:SS.(F)Z format. The fractional_part is rounded to the nearest nano second
- Parameters
-
epoch_sec | const reference to a uint64_t to the epoch second |
fractional_part | const reference to a double containing the factional second |
date | reference to a std::string object where the date string is to be stored |
- Returns
- a boolean indicating if the conversion was successful
◆ ConvertTimeStampToEpochSecond()
bool hops::MHO_TimeStampConverter::ConvertTimeStampToEpochSecond |
( |
const std::string & |
date_string, |
|
|
uint64_t & |
epoch_sec, |
|
|
double & |
fractional_part |
|
) |
| |
|
static |
- Convert a date string into an epoch second and fractional second. The time stamp must be in UTC/Zulu with format: YYYY-MM-DDTHH:MM:SS.(F)Z, the number of digits in the fractional part (F) may vary.
- Parameters
-
date | const reference to the date string to be converted |
epoch_sec | reference to a uint64_t where the epoch second value is to be stored |
fractional_part | reference to a double where the factional second value is to be stored |
- Returns
- a boolean indicating if the conversion was successful
The documentation for this class was generated from the following files: