From a62792235d335341caa0d47238fae11b06c73b3a Mon Sep 17 00:00:00 2001 From: Serein <2075337935@qq.com> Date: Fri, 25 Oct 2024 00:55:04 +0800 Subject: [PATCH] fix: first date time of week --- src/Infrastructure/Utils/Tools.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/Infrastructure/Utils/Tools.h b/src/Infrastructure/Utils/Tools.h index 570f240..1654096 100644 --- a/src/Infrastructure/Utils/Tools.h +++ b/src/Infrastructure/Utils/Tools.h @@ -64,9 +64,6 @@ inline std::string firstDateTimeOfWeek() { auto now = std::chrono::system_clock::now(); auto time = std::chrono::system_clock::to_time_t(now); auto tm = std::gmtime(&time); - tm->tm_hour = 0; - tm->tm_min = 0; - tm->tm_sec = 0; // Find the start of the week (Monday) int daysSinceMonday = (tm->tm_wday + 6) % 7; @@ -75,7 +72,7 @@ inline std::string firstDateTimeOfWeek() { // Format the date std::stringstream ss; auto startOfWeekTime = std::chrono::system_clock::to_time_t(startOfWeek); - ss << std::put_time(std::gmtime(&startOfWeekTime), "%Y-%m-%dT%H:%M:%S.000Z"); + ss << std::put_time(std::gmtime(&startOfWeekTime), "%Y-%m-%dT00:00:00"); return ss.str(); }