33 using namespace std::chrono;
34 auto now = system_clock::now();
35 std::time_t current = system_clock::to_time_t(now);
36 std::tm local = *std::localtime(¤t);
38 std::strftime(buffer,
sizeof(buffer),
"%Y-%m-%dT%H:%M:%S", &local);
39 auto dur = now.time_since_epoch();
40 auto ms = duration_cast<milliseconds>(dur) % 1000;
41 std::ostringstream oss;
42 oss << buffer <<
'.' << std::setfill(
'0') << std::setw(3) << ms.count();
std::string get_timestamp()
Returns a formatted string for displaying time.