From dae7794bdfda81460beb26ad90a3beec2ab18bf2 Mon Sep 17 00:00:00 2001 From: Viktar Lukashonak Date: Tue, 25 Jul 2023 00:08:05 +0300 Subject: [PATCH] Clock. Narrow seconds precision Signed-off-by: Viktar Lukashonak --- src/modules/clock.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/modules/clock.cpp b/src/modules/clock.cpp index 15d0319..ed21faa 100644 --- a/src/modules/clock.cpp +++ b/src/modules/clock.cpp @@ -164,7 +164,9 @@ const date::time_zone* waybar::modules::Clock::current_timezone() { auto waybar::modules::Clock::update() -> void { const auto* tz{current_timezone()}; const date::zoned_time now{ - tz, std::chrono::system_clock::now()}; // Define local time is based on provided time zone + tz, + date::floor( + std::chrono::system_clock::now())}; // Define local time is based on provided time zone const date::year_month_day today{ date::floor(now.get_local_time())}; // Convert now to year_month_day const date::year_month_day shiftedDay{today + cldCurrShift_}; // Shift today