Fesapi 2.3.0.0
This project provides C++ classes which allow an easy access in import and export to the Energistics standards.
Functions
timeTools Namespace Reference

The timeTools namespace. More...

Functions

std::string convertUnixTimestampToIso (time_t ts)
 
time_t convertIsoToUnixTimestamp (const std::string &s)
 
time_t timegm (std::tm const &t)
 
template<typename Clock , typename Duration >
std::tm to_calendar_time (std::chrono::time_point< Clock, Duration > tp)
 

Detailed Description

The timeTools namespace.

Function Documentation

◆ convertIsoToUnixTimestamp()

time_t timeTools::convertIsoToUnixTimestamp ( const std::string &  s)

Converts a UTC time (given in seconds) represented by a string to a UTC time represented by a time_t type.

Parameters
sA std::string to process.
Returns
The ISO converted to unix timestamp.

◆ convertUnixTimestampToIso()

std::string timeTools::convertUnixTimestampToIso ( time_t  ts)

Convert an Unix timestamp which is given in microseconds into a date in ISO format. Convert an Unix timestamp which is given in seconds into a date in ISO format.

Parameters
tsThe ts.
Returns
The unix converted timestamp to ISO.

◆ timegm()

time_t timeTools::timegm ( std::tm const &  t)

Converts a UTC time represented by a tm``struct to a UTC time represented by a time_t type.

Parameters
[in,out]tmIf non-null, the time.
Returns
A time_t.

◆ to_calendar_time()

template<typename Clock , typename Duration >
std::tm timeTools::to_calendar_time ( std::chrono::time_point< Clock, Duration >  tp)

Converts a UTC time represented by a point in time to the same UTC time represented by tm``struct. From https://github.com/HowardHinnant/date/wiki/Examples-and-Recipes#components_to_time_point

Parameters
[in,out]tpThe point in time to convert.
Returns
the same point in time in a tm``struct.