Sfoglia il codice sorgente

Kernel: Fix wrong calculation of current Unix timestamp.

Andreas Kling 6 anni fa
parent
commit
fad69464f6
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1 1
      Kernel/RTC.cpp

+ 1 - 1
Kernel/RTC.cpp

@@ -92,7 +92,7 @@ time_t now()
 
 
     return days_in_years_since_epoch(year - 1) * 86400
     return days_in_years_since_epoch(year - 1) * 86400
          + days_in_months_since_start_of_year(month - 1, year) * 86400
          + days_in_months_since_start_of_year(month - 1, year) * 86400
-         + day * 86400
+         + (day - 1) * 86400
          + hour * 3600
          + hour * 3600
          + minute * 60
          + minute * 60
          + second;
          + second;