Crypto backtesting
Loading...
Searching...
No Matches
time.cxx File Reference
#include <ctime>
#include <iomanip>
#include <sstream>
#include <string>
Include dependency graph for time.cxx:

Go to the source code of this file.

Functions

std::string epoch_to_utc (const size_t epoch)
 Routine to convert epoch seconds to a UTC time string.

Function Documentation

◆ epoch_to_utc()

std::string epoch_to_utc ( const size_t epoch)

Routine to convert epoch seconds to a UTC time string.

Definition at line 7 of file time.cxx.

7 {
8 std::time_t t = epoch;
9 std::tm tm = *std::gmtime(&t);
10 std::ostringstream oss;
11 oss << std::put_time(&tm, "%Y-%m-%d %H:%M:%S");
12 return oss.str();
13}
Here is the caller graph for this function: