diff --git a/scheduler/schedule.cpp b/scheduler/schedule.cpp index f46ced5..52c1705 100644 --- a/scheduler/schedule.cpp +++ b/scheduler/schedule.cpp @@ -578,6 +578,10 @@ std::string SensorScheduler::GetUTCTime(long ts) { std::time_t utcTime = std::chrono::system_clock::to_time_t(timePoint); std::tm* local_time = std::gmtime(&utcTime); local_time->tm_hour = local_time->tm_hour + 8; + if (local_time->tm_hour > 24) { + local_time->tm_hour -= 24; + local_time->tm_mday += 1; + } char str[100] = {0}; snprintf(str, sizeof(str), "%04d-%02d-%02d %02d:%02d:%02d", local_time->tm_year + 1900, local_time->tm_mon+1, local_time->tm_mday, local_time->tm_hour, local_time->tm_min, local_time->tm_sec);