community-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1759924 - /comdev/reporter.apache.org/trunk/scripts/mailglomper2.py
Date Thu, 08 Sep 2016 22:55:33 GMT
Author: sebb
Date: Thu Sep  8 22:55:33 2016
New Revision: 1759924

URL: http://svn.apache.org/viewvc?rev=1759924&view=rev
Log:
Always use UTC dates

Modified:
    comdev/reporter.apache.org/trunk/scripts/mailglomper2.py

Modified: comdev/reporter.apache.org/trunk/scripts/mailglomper2.py
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/scripts/mailglomper2.py?rev=1759924&r1=1759923&r2=1759924&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/scripts/mailglomper2.py (original)
+++ comdev/reporter.apache.org/trunk/scripts/mailglomper2.py Thu Sep  8 22:55:33 2016
@@ -13,7 +13,7 @@
 import sys
 if sys.hexversion < 0x03000000:
     raise ImportError("This script requires Python 3")
-import re, json, os, time, email.utils, signal
+import re, json, os, time, email.utils, signal, calendar
 from datetime import datetime
 import urlutils
 import urllib.error
@@ -182,7 +182,7 @@ def weekly_stats(ml, date):
                 ct += 1
                 try:
                     d = email.utils.parsedate(c.group(1).decode('latin1')) # convert match
to string
-                    timestamp = int(time.mktime(d))
+                    timestamp = int(calendar.timegm(d))
                     rounded = timestamp - (timestamp % SECS_PER_WEEK) + SECS_PER_WEEK
                     weekly[rounded] = (weekly[rounded] if rounded in weekly else 0) + 1
                 except Exception as err:



Mime
View raw message