diff --git a/services/time_manager/src/time_zone_info.cpp b/services/time_manager/src/time_zone_info.cpp index 1e70269..20e0ca4 100644 --- a/services/time_manager/src/time_zone_info.cpp +++ b/services/time_manager/src/time_zone_info.cpp @@ -142,9 +142,9 @@ bool TimeZoneInfo::GetTimezone(std::string &timezoneId) int64_t TimeZoneInfo::GetCurrentOffsetMs() { - int offsetHours; + int offsetHours = 0; GetOffsetById(curTimezoneId_, offsetHours); - return offsetHours * HOUR_TO_MILLISECONDS; + return static_cast(offsetHours) * HOUR_TO_MILLISECONDS; } bool TimeZoneInfo::SetOffsetToKernel(int offsetHour)