Avoid UTC datetime

utcfromtimestamp() does not seems reliable and qubes-manager uses local time
This commit is contained in:
donoban 2018-03-07 16:40:07 -05:00
parent b3b18f97f8
commit 6e8e48e32d
No known key found for this signature in database
GPG Key ID: 141310D8E3ED08A5

View File

@ -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):