fixed date error

This commit is contained in:
2026-01-07 12:00:05 +01:00
parent 671bfc0a35
commit 0e0bc02441
2 changed files with 5 additions and 4 deletions

View File

@@ -51,11 +51,10 @@ std::optional<Metadata> get_metadata(const std::string &FILE_PATH) {
if (toml_time.is_date()) {
toml::date d = toml_time.as_date()->get();
// To convert to a Unix timestamp (time_t):
t.tm_year = d.year - 1900; // tm_year is years since 1900
t.tm_mon = d.month - 1; // tm_mon is 0-11
t.tm_year = d.year - 1900;
t.tm_mon = d.month - 1;
t.tm_mday = d.day;
t.tm_isdst = -1;
t.tm_isdst = 0;
timestamp = mktime(&t);
}