From: Boris Lytochkin Date: Mon, 23 Nov 2020 20:21:42 +0000 (+0300) Subject: make 'utc = yes' works for converting strings into unix timestamp X-Git-Tag: release_3_0_22~334 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7ea17db2d2;p=thirdparty%2Ffreeradius-server.git make 'utc = yes' works for converting strings into unix timestamp as well. --- diff --git a/src/modules/rlm_date/rlm_date.c b/src/modules/rlm_date/rlm_date.c index 86a7d6220f9..79191e73d87 100644 --- a/src/modules/rlm_date/rlm_date.c +++ b/src/modules/rlm_date/rlm_date.c @@ -95,7 +95,11 @@ static ssize_t xlat_date_convert(void *instance, REQUEST *request, char const *f goto error; } - date = mktime(&tminfo); + if (!inst->utc) { + date = mktime(&tminfo); + } else { + date = timegm(&tminfo); + } if (date < 0) { REDEBUG("Failed converting parsed time into unix time");