From 6e8e48e32d54c832aabb1a0578587b5e6da0df2b Mon Sep 17 00:00:00 2001 From: donoban Date: Wed, 7 Mar 2018 16:40:07 -0500 Subject: [PATCH] Avoid UTC datetime utcfromtimestamp() does not seems reliable and qubes-manager uses local time --- qubes/firewall.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qubes/firewall.py b/qubes/firewall.py index 4cd47e3e..74a93685 100644 --- a/qubes/firewall.py +++ b/qubes/firewall.py @@ -204,7 +204,7 @@ class SpecialTarget(RuleChoice): class Expire(RuleOption): def __init__(self, untrusted_value): super(Expire, self).__init__(untrusted_value) - self.datetime = datetime.datetime.utcfromtimestamp(int(untrusted_value)) + self.datetime = datetime.datetime.fromtimestamp(int(untrusted_value)) @property def rule(self): @@ -216,7 +216,7 @@ class Expire(RuleOption): @property def expired(self): - return self.datetime < datetime.datetime.utcnow() + return self.datetime < datetime.datetime.now() class Comment(RuleOption):