You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@community.apache.org by se...@apache.org on 2016/09/08 22:55:33 UTC

svn commit: r1759924 - /comdev/reporter.apache.org/trunk/scripts/mailglomper2.py

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: