From d4bc1bbd9c20e2a4754760bfbfcb19340cc986e5 Mon Sep 17 00:00:00 2001 From: Federico Amedeo Izzo Date: Mon, 28 Dec 2020 16:02:41 +0100 Subject: [PATCH] RTC: Fix Linux RTC driver date format --- platform/mcu/x86_64/drivers/rtc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/platform/mcu/x86_64/drivers/rtc.c b/platform/mcu/x86_64/drivers/rtc.c index 2671af63..45d9b903 100644 --- a/platform/mcu/x86_64/drivers/rtc.c +++ b/platform/mcu/x86_64/drivers/rtc.c @@ -58,9 +58,11 @@ curTime_t rtc_getTime() t.hour = timeinfo->tm_hour; t.minute = timeinfo->tm_min; t.second = timeinfo->tm_sec; - t.year = timeinfo->tm_year + 1900; - t.day = timeinfo->tm_mday; + t.day = timeinfo->tm_wday; + t.date = timeinfo->tm_mday; t.month = timeinfo->tm_mon + 1; + // Only last two digits of the year are supported in OpenRTX + t.year = (timeinfo->tm_year + 1900) % 100; return t; }