Skip to content

Commit

Permalink
Merge pull request #2345 from LukashonakV/ISSUE_2344
Browse files Browse the repository at this point in the history
Clock. Narrow seconds precision
  • Loading branch information
Alexays authored Jul 24, 2023
2 parents c087d8c + dae7794 commit 9207fff
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/modules/clock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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::seconds>(
std::chrono::system_clock::now())}; // Define local time is based on provided time zone
const date::year_month_day today{
date::floor<date::days>(now.get_local_time())}; // Convert now to year_month_day
const date::year_month_day shiftedDay{today + cldCurrShift_}; // Shift today
Expand Down

0 comments on commit 9207fff

Please sign in to comment.