From 25c9497a3e67c966103378eed93cbe33438041c8 Mon Sep 17 00:00:00 2001 From: myslqyr <125962528+myslqyr@users.noreply.github.com> Date: Sun, 19 Apr 2026 13:48:07 +0800 Subject: [PATCH] Fix incorrect log time display. Replace gmtime_s with localtime_s to display local time instead of UTC. --- frontend/windows-frontend/logging.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/windows-frontend/logging.cc b/frontend/windows-frontend/logging.cc index 4e8605b..a3f3e77 100644 --- a/frontend/windows-frontend/logging.cc +++ b/frontend/windows-frontend/logging.cc @@ -31,7 +31,7 @@ std::string Timestamp::YYYY_MM_DD_HH_MM_SS_UUUUUU() const time_t seconds = _us_since_epoch / 1000000ull; int64_t us = _us_since_epoch % 1000000ull; - ::gmtime_s(&tm_time, &seconds); + ::localtime_s(&tm_time, &seconds); char buf[64]; std::snprintf(buf, 64, "%04d-%02d-%02d %02d:%02d:%02d.%06d" @@ -91,4 +91,4 @@ void Logger::log(int level, const std::string& msg) std::lock_guard lock(_mutex); std::cout << Timestamp::now().YYYY_MM_DD_HH_MM_SS_UUUUUU() << " " << logger_ctx::get_ctx_string() << __level_label[level] << " " << msg << " " << std::endl; -} \ No newline at end of file +}