How to convert C++ chrono time in UTC to string in UTC
问题 How to convert C++ chrono time in UTC to string in UTC? Because in my tests when convert chrono time to string it is using different timezone. Example: #include <iostream> #include <string> #include <chrono> #include <sstream> #include <iomanip> #include <cstdint> #include <ctime> std::string getStringFromDateTime(const std::chrono::system_clock::time_point & value) { std::time_t time_now_t = std::chrono::system_clock::to_time_t(value); std::tm now_tm = *std::localtime(&time_now_t); char buf