Skip to content

Commit a72935d

Browse files
committed
Fixing the timestamp printing issue in the main.cpp file. . The error occurs because we're trying to directly print a chrono::time_point object, which doesn't have a stream operator overload.
1 parent 33a08e1 commit a72935d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

source/main.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include <vector>
1010
#include <memory>
1111
#include <string>
12+
#include <iomanip>
1213

1314
// external headers
1415
#include <nlohmann/json.hpp>
@@ -60,7 +61,9 @@ int main(int argc, const char * argv[]) {
6061

6162
std::vector<PriceData> priceData = db.executeQuery(query);
6263

63-
std::cout << priceData[0].timestamp;
64+
// Convert timestamp to readable format for debugging
65+
auto timeT = std::chrono::system_clock::to_time_t(priceData[0].timestamp);
66+
std::cout << "Timestamp: " << std::put_time(std::localtime(&timeT), "%Y-%m-%d %H:%M:%S") << std::endl;
6467

6568
auto tradeManager = TradeManager::getInstance();
6669

0 commit comments

Comments
 (0)