From 019a25eda277aba369b197900f0a2dbb3a145807 Mon Sep 17 00:00:00 2001 From: Drath Vader Date: Fri, 24 Oct 2025 15:10:32 +0200 Subject: [PATCH] log in local time --- include/log.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/log.hpp b/include/log.hpp index 5f55fed..e7fefdb 100644 --- a/include/log.hpp +++ b/include/log.hpp @@ -49,7 +49,8 @@ inline void _log(LOG level, std::string_view tag, std::format_string st /* log to file */ if (logToFile) { auto now = std::chrono::system_clock::now(); - std::string msg = std::format("{:%x %H:%M:%S }", floor(now)); // timestamp + auto local = std::chrono::current_zone()->to_local(now); + std::string msg = std::format("{:%x %H:%M:%S }", floor(local)); // timestamp std::format_to(std::back_inserter(msg), pattern, color, tag, reset); // tag std::format_to(std::back_inserter(msg), str, std::forward(args)...); // actual log message