summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiltjo Posthuma <hiltjo@codemadness.org>2023-03-26 18:03:24 +0200
committerHiltjo Posthuma <hiltjo@codemadness.org>2023-03-26 18:03:24 +0200
commitc7739b9c04b4b49888e1161164b1cdac0d9930ca (patch)
tree97b040e7432287fb536574448b54f28e5e98eacf
parent04db56ad05b207374c973b8651a6bfa14bbbac4b (diff)
sfeed.c: datetounix: simplify calculation and make it slightly easier to read
This also fixes a calculation (possibly a compiler bug) with Open Watcom 1.9.
-rw-r--r--sfeed.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sfeed.c b/sfeed.c
index 2956505..4337300 100644
--- a/sfeed.c
+++ b/sfeed.c
@@ -475,7 +475,7 @@ datetounix(long long year, int mon, int day, int hour, int min, int sec)
}
}
leaps += 97 * cycles + 24 * centuries - is_leap;
- t = (year - 100) * 31536000LL + leaps * 86400LL + 946684800 + 86400;
+ t = ((year - 100) * 31536000LL) + (leaps * 86400LL) + 946771200LL;
}
t += secs_through_month[mon];
if (is_leap && mon >= 2)