summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrsiddharth <s@ricketyspace.net>2016-11-05 21:51:43 +0000
committerLars Wirzenius <liw@liw.fi>2016-12-26 17:42:24 +0200
commitb577217beec1141f37054618546be2277d10f698 (patch)
tree31446a936577277fe36438399db28443b8f5d157
parent17d1ab7e1906e3c849a43b318e0c6e25463a636b (diff)
downloaddistix-b577217beec1141f37054618546be2277d10f698.tar.gz
Fix distixlib.Ticket._get_message_timestamp method.
Use `email.utils.parsedate_tz` and `email.utils.mktime_tz` to get the POSIX timestamp in `distixlib.Ticket._get_message_timestamp` method. * distixlib/ticket.py (_get_message_timestamp): Update method. From liw: turns out this test would never fail for timezone UTC+2, and always fail otherwise.
-rw-r--r--distixlib/ticket.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/distixlib/ticket.py b/distixlib/ticket.py
index 8e4e3cc..907b1d0 100644
--- a/distixlib/ticket.py
+++ b/distixlib/ticket.py
@@ -17,7 +17,6 @@
import email
-import time
import distixlib
@@ -95,4 +94,4 @@ class Ticket(object):
def _get_message_timestamp(self, message):
date = message.get('Date', 'Thu, 01 Jan 1970 00:00:00 +0000')
- return time.mktime(email.utils.parsedate(date))
+ return email.utils.mktime_tz(email.utils.parsedate_tz(date))