HOPS
HOPS class reference
Public Member Functions | Static Public Member Functions | List of all members
hops::MHO_TimeStampConverter Class Reference

Class MHO_TimeStampConverter. More...

#include <MHO_TimeStampConverter.hh>

Public Member Functions

 MHO_TimeStampConverter ()
 
 ~MHO_TimeStampConverter ()
 

Static Public Member Functions

static bool ConvertEpochSecondToTimeStamp (const uint64_t &epoch_sec, const double &fractional_part, std::string &date_string)
 
static bool ConvertTimeStampToEpochSecond (const std::string &date_string, uint64_t &epoch_sec, double &fractional_part)
 

Detailed Description

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

Constructor & Destructor Documentation

◆ MHO_TimeStampConverter()

hops::MHO_TimeStampConverter::MHO_TimeStampConverter ( )
inline

◆ ~MHO_TimeStampConverter()

hops::MHO_TimeStampConverter::~MHO_TimeStampConverter ( )
inline

Member Function Documentation

◆ 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_secconst reference to a uint64_t to the epoch second
    fractional_partconst reference to a double containing the factional second
    datereference 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
    dateconst reference to the date string to be converted
    epoch_secreference to a uint64_t where the epoch second value is to be stored
    fractional_partreference 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: