From 4a0fcfb2433aa72dc24cd5d0900508f0db05974f Mon Sep 17 00:00:00 2001 From: bzt Date: Sat, 22 Jan 2022 15:16:33 +0100 Subject: [PATCH] year workaround in struct tm --- uefi/time.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uefi/time.c b/uefi/time.c index ffa5e65..4773129 100644 --- a/uefi/time.c +++ b/uefi/time.c @@ -83,7 +83,7 @@ uint64_t __year_to_secs(uint64_t year, int *is_leap) time_t __mktime_efi(efi_time_t *t) { - __tm.tm_year = t->Year + 98; + __tm.tm_year = t->Year + (/* workaround some buggy firmware*/ t->Year > 2000 ? -1900 : 98); __tm.tm_mon = t->Month - 1; __tm.tm_mday = t->Day; __tm.tm_hour = t->Hour;