Skip to content

Commit

Permalink
fix: first date time of week
Browse files Browse the repository at this point in the history
  • Loading branch information
Serein207 committed Oct 24, 2024
1 parent f36baa7 commit a627922
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/Infrastructure/Utils/Tools.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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();
}

Expand Down

0 comments on commit a627922

Please sign in to comment.