From 103b7f8b7551ca99023f100002ed08bea72e011a Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Sat, 13 Jun 2026 22:32:59 +0200 Subject: use std:: facilities for timestamp formatting --- server/common/log.hpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'server/common') diff --git a/server/common/log.hpp b/server/common/log.hpp index 505faed..573590b 100644 --- a/server/common/log.hpp +++ b/server/common/log.hpp @@ -5,10 +5,8 @@ #pragma once -#include #include -#include #include #include #include @@ -20,7 +18,6 @@ #include namespace math::server::log { - namespace details { inline std::string get_tid() { @@ -30,11 +27,8 @@ inline std::string get_tid() { } inline std::string get_timestamp() { - const auto now = boost::posix_time::second_clock::universal_time(); - const auto tm = boost::posix_time::to_tm(now); - std::ostringstream oss; - oss << std::put_time(&tm, "%Y-%m-%d %H:%M:%S"); - return oss.str(); + const auto now = std::chrono::system_clock::now(); + return std::format("{:%F %T%z}", std::chrono::floor(now)); } inline void log(const std::string& msg) { -- cgit v1.3