From: Vsevolod Stakhov Date: Wed, 1 May 2019 12:42:33 +0000 (+0100) Subject: [Fix] Switch to GMT X-Git-Tag: 1.9.3~45 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=f4efae27e91d2666c10097701c5d1345a4b92cf7;p=rspamd.git [Fix] Switch to GMT --- diff --git a/lualib/rspamadm/vault.lua b/lualib/rspamadm/vault.lua index b11ba525e..0dadaaeb4 100644 --- a/lualib/rspamadm/vault.lua +++ b/lualib/rspamadm/vault.lua @@ -318,7 +318,7 @@ local function newkey_handler(opts, domain) if not opts.selector then opts.selector = string.format('%s-%s', opts.algorithm, - os.date("%Y%m%d")) + os.date("!%Y%m%d")) end local err,data = rspamd_http.request{ @@ -458,7 +458,7 @@ local function roll_handler(opts, domain) -- Insert keys for each algorithm in pairs , local sk,pk = genkey({algorithm = alg, bits = keys[1].bits}) local selector = string.format('%s-%s', alg, - os.date("%Y%m%d")) + os.date("!%Y%m%d")) if selector == keys[1].selector then selector = selector .. '-1' diff --git a/src/plugins/lua/clickhouse.lua b/src/plugins/lua/clickhouse.lua index 9559ef5cb..6e427682f 100644 --- a/src/plugins/lua/clickhouse.lua +++ b/src/plugins/lua/clickhouse.lua @@ -289,7 +289,7 @@ local function clickhouse_asn_row(res) end local function today(ts) - return os.date('%Y-%m-%d', ts) + return os.date('!%Y-%m-%d', ts) end local function clickhouse_check_symbol(task, symbols, need_score) diff --git a/src/plugins/lua/dmarc.lua b/src/plugins/lua/dmarc.lua index 8c22f84b2..2c9bf1951 100644 --- a/src/plugins/lua/dmarc.lua +++ b/src/plugins/lua/dmarc.lua @@ -528,7 +528,7 @@ local function dmarc_validate_policy(task, policy, hdrfromdom, dmarc_esld) end -- Prepare and send redis report element - local period = os.date('%Y%m%d', + local period = os.date('!%Y%m%d', task:get_date({format = 'connect', gmt = true})) local dmarc_domain_key = table.concat( {redis_keys.report_prefix, hdrfromdom, period}, redis_keys.join_char)