From: Arran Cudbard-Bell Date: Thu, 2 Dec 2021 17:08:42 +0000 (-0600) Subject: Apply timezone offset correctly X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2e4357dca3019fadbedd6b9f0fb6a1baeecc273c;p=thirdparty%2Ffreeradius-server.git Apply timezone offset correctly --- diff --git a/src/lib/util/time.c b/src/lib/util/time.c index df36cc9de48..ebe13a9a0d2 100644 --- a/src/lib/util/time.c +++ b/src/lib/util/time.c @@ -668,7 +668,8 @@ fr_unix_time_t fr_unix_time_from_tm(struct tm *tm) * 2472692 adjusts the days for Unix epoch. It is calculated as * (365.2425 * (4800 + 1970)) */ - return fr_unix_time_from_sec((days - 2472692) * 86400 + (tm->tm_hour * 3600) + (tm->tm_min * 60) + tm->tm_sec + tm->tm_gmtoff); + return fr_unix_time_from_sec((((days - 2472692) * 86400) + (tm->tm_hour * 3600) + + (tm->tm_min * 60) + tm->tm_sec) - tm->tm_gmtoff); } /** Scale an input time to NSEC, clamping it at max / min.