Skip to content

Commit a909c21

Browse files
committed
unix/fatfs_port: Fix month offset in timestamp calculation.
Signed-off-by: Damien George <[email protected]>
1 parent 2a72e90 commit a909c21

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ports/unix/fatfs_port.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ DWORD get_fattime(void) {
55
time_t now = time(NULL);
66
struct tm *tm = localtime(&now);
77
return ((1900 + tm->tm_year - 1980) << 25)
8-
| (tm->tm_mon << 21)
8+
| ((tm->tm_mon + 1) << 21)
99
| (tm->tm_mday << 16)
1010
| (tm->tm_hour << 11)
1111
| (tm->tm_min << 5)

0 commit comments

Comments
 (0)