diff --git a/ports/unix/fatfs_port.c b/ports/unix/fatfs_port.c index 4ec5b919ab..9e0f444ce2 100644 --- a/ports/unix/fatfs_port.c +++ b/ports/unix/fatfs_port.c @@ -5,7 +5,7 @@ DWORD get_fattime(void) { time_t now = time(NULL); struct tm *tm = localtime(&now); return ((1900 + tm->tm_year - 1980) << 25) - | (tm->tm_mon << 21) + | ((tm->tm_mon + 1) << 21) | (tm->tm_mday << 16) | (tm->tm_hour << 11) | (tm->tm_min << 5)