diff options
| author | Damien George <damien@micropython.org> | 2020-08-31 14:59:10 +1000 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2020-09-02 00:19:06 +1000 |
| commit | a909c215879d94e7e76046f71f38e881949fe7dc (patch) | |
| tree | 285eaed99527bec4218b360da020ba29233e2da5 | |
| parent | 2a72e90ab8969b69304d84aa7070720d63c60d06 (diff) | |
unix/fatfs_port: Fix month offset in timestamp calculation.
Signed-off-by: Damien George <damien@micropython.org>
| -rw-r--r-- | ports/unix/fatfs_port.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ports/unix/fatfs_port.c b/ports/unix/fatfs_port.c index 4ec5b919a..9e0f444ce 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) |
