]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* include/grub/datetime.h (grub_datetime2unixtime): Fix offset.
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sat, 14 Jan 2012 10:51:52 +0000 (11:51 +0100)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sat, 14 Jan 2012 10:51:52 +0000 (11:51 +0100)
ChangeLog
include/grub/datetime.h

index ce3b201920e50678abba53ed7331009c41233351..8f06d2217f4efcf12737f6311d00f50c67ea2193 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2012-01-14  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * include/grub/datetime.h (grub_datetime2unixtime): Fix offset.
+
 2012-01-14  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * grub-core/lib/posix_wrap/stdlib.h (MB_CUR_MAX): Moved from here ...
index a7154fa1a9158c3b4237f1114f5ab3cb74c04f28..66c1aa2feaca8a3f4c38ad6d03f70223e52f3d03 100644 (file)
@@ -85,14 +85,14 @@ grub_datetime2unixtime (const struct grub_datetime *datetime, grub_int32_t *nix)
   /* In the period of validity of unixtime all years divisible by 4
      are bissextile*/
   /* Convenience: let's have 3 consecutive non-bissextile years
-     at the beginning of the epoch. So count from 1971 instead of 1970 */
-  ret = 2 * SECPERYEAR + SECPERDAY;
+     at the beginning of the epoch. So count from 1973 instead of 1970 */
+  ret = 3 * SECPERYEAR + SECPERDAY;
 
   /* Transform C divisions and modulos to mathematical ones */
-  y4 = (datetime->year - 1972) / 4;
-  if (datetime->year < 1972)
+  y4 = (datetime->year - 1973) / 4;
+  if (datetime->year < 1973)
     y4--;
-  ay = datetime->year - 1972 - 4 * y4;
+  ay = datetime->year - 1973 - 4 * y4;
   ret += y4 * SECPER4YEARS;
   ret += ay * SECPERYEAR;