8000 rp2/datetime_patch: Fix year and month offset for mktime wrapper. · micropython/micropython@47741e2 · GitHub
[go: up one dir, main page]

Skip to content

Commit 47741e2

Browse files
committed
rp2/datetime_patch: Fix year and month offset for mktime wrapper.
Signed-off-by: Damien George <damien@micropython.org>
1 parent 43bd57f commit 47741e2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ports/rp2/datetime_patch.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,5 @@ struct tm *localtime_r(const time_t *__restrict time, struct tm *__restrict loca
3838
}
3939

4040
time_t mktime(struct tm *__restrict tm) {
41-
return timeutils_mktime(tm->tm_year, tm->tm_mon, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec);
41+
return timeutils_mktime(tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec);
4242
}

0 commit comments

Comments
 (0)
0