Crypto backtesting
Loading...
Searching...
No Matches
backtest
time.cxx
Go to the documentation of this file.
1
#include <ctime>
2
#include <iomanip>
3
#include <sstream>
4
#include <string>
5
6
/// Routine to convert epoch seconds to a UTC time string
7
std::string
epoch_to_utc
(
const
size_t
epoch) {
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
}
epoch_to_utc
std::string epoch_to_utc(const size_t epoch)
Routine to convert epoch seconds to a UTC time string.
Definition
time.cxx:7
Generated by
1.15.0