From 47741e2757db616de2b1f6f05e47ae52f336b3fd Mon Sep 17 00:00:00 2001 From: Damien George Date: Thu, 24 Oct 2024 11:22:59 +1100 Subject: [PATCH] rp2/datetime_patch: Fix year and month offset for mktime wrapper. Signed-off-by: Damien George --- ports/rp2/datetime_patch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/rp2/datetime_patch.c b/ports/rp2/datetime_patch.c index 810af4cf1..73bea7429 100644 --- a/ports/rp2/datetime_patch.c +++ b/ports/rp2/datetime_patch.c @@ -38,5 +38,5 @@ struct tm *localtime_r(const time_t *__restrict time, struct tm *__restrict loca } time_t mktime(struct tm *__restrict tm) { - return timeutils_mktime(tm->tm_year, tm->tm_mon, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec); + return timeutils_mktime(tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec); }