From ae669917ba52bec2c99dd1741779447965d82dda Mon Sep 17 00:00:00 2001 From: Tristan Riehs Date: Sun, 16 Nov 2025 16:04:02 +0100 Subject: Fix date parsing --- src/main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/main.c b/src/main.c index 51ae8e4..148712f 100644 --- a/src/main.c +++ b/src/main.c @@ -237,7 +237,10 @@ static void ftag_add_one_file(sqlite3 *db, if (read_len > 1) { struct tm tm; memset(&tm, 0, sizeof(tm)); - rc = sscanf(date_str, "%d-%d-%d\n", &tm.tm_year, &tm.tm_mon, &tm.tm_mday); + rc = sscanf(date_str, "%d-%d-%d\n", + &tm.tm_year, &tm.tm_mon, &tm.tm_mday); + tm.tm_year -= 1900; + tm.tm_mon -= 1; date = mktime(&tm); if (rc != 3) { perror("sccanf"); -- cgit v1.2.3