[mhonarc] bug fix: avoid timezone conversions
- From: Olav Vitters <ovitters src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mhonarc] bug fix: avoid timezone conversions
- Date: Wed, 13 Feb 2013 23:13:09 +0000 (UTC)
commit d32be9431da73ac4f02ac99f42086bd13aa126e1
Author: Olav Vitters <olav vitters nl>
Date: Thu Feb 14 00:13:03 2013 +0100
bug fix: avoid timezone conversions
archive.py | 13 ++++++-------
1 files changed, 6 insertions(+), 7 deletions(-)
---
diff --git a/archive.py b/archive.py
index 2aa33a6..5159363 100755
--- a/archive.py
+++ b/archive.py
@@ -140,17 +140,16 @@ class Archiver:
# Determine received time
for text in received_texts:
if ';' not in text: continue
- time = email.utils.parsedate_tz(text.rpartition(';')[2])
- if time is None:
+ received_time = email.utils.parsedate_tz(text.rpartition(';')[2])
+ if received_time is None:
continue
try:
- time = email.utils.mktime_tz(time)
+ received_time = email.utils.mktime_tz(received_time)
except ValueError:
- time = None
+ received_time = None
- if time is not None:
- received_time = datetime.datetime.fromtimestamp(time)
- received_time_text = text
+ if received_time is not None:
+ received_time = datetime.datetime.utcfromtimestamp(received_time)
break
if received_time is None:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]