diff --git a/kernel/src/Timekeeping/Time.cpp b/kernel/src/Timekeeping/Time.cpp index 389bced..8ad8e9d 100644 --- a/kernel/src/Timekeeping/Time.cpp +++ b/kernel/src/Timekeeping/Time.cpp @@ -70,14 +70,19 @@ static Timekeeping::DateTime EpochToDate(int64_t epoch) { void Timekeeping::Init(uint16_t Year, uint8_t Month, uint8_t Day, uint8_t Hour, uint8_t Minute, uint8_t Second) { g_bootEpoch = DateToEpoch(Year, Month, Day, Hour, Minute, Second); - int offH = g_tzOffsetMinutes / 60; - int offM = g_tzOffsetMinutes % 60; - if (offM < 0) offM = -offM; + int64_t absoluteOffset = g_tzOffsetMinutes; + char sign = '+'; + if (absoluteOffset < 0) { + sign = '-'; + absoluteOffset = -absoluteOffset; + } - Kt::KernelLogStream(INFO, "Timekeeping Service") << "Time zone: UTC" - << (offH >= 0 ? "+" : "") << offH - << (offM ? ":" : "") << (offM >= 10 ? "" : (offM ? "0" : "")) - << (offM ? offM : 0); + int offH = (int)(absoluteOffset / 60); + int offM = (int)(absoluteOffset % 60); + auto log = Kt::KernelLogStream(INFO, "Timekeeping Service"); + log << "Time zone: UTC" << sign << offH; + if (offM != 0) + log << ":" << (offM < 10 ? "0" : "") << offM; } int64_t Timekeeping::GetUnixTimestamp() {