community-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1759919 - /comdev/reporter.apache.org/trunk/site/jiraversions.py
Date Thu, 08 Sep 2016 22:24:45 GMT
Author: sebb
Date: Thu Sep  8 22:24:45 2016
New Revision: 1759919

URL: http://svn.apache.org/viewvc?rev=1759919&view=rev
Log:
COMDEV-203 Timezone issues with release dates
Fix JIRA dates to always use UTC.

Modified:
    comdev/reporter.apache.org/trunk/site/jiraversions.py

Modified: comdev/reporter.apache.org/trunk/site/jiraversions.py
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/site/jiraversions.py?rev=1759919&r1=1759918&r2=1759919&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/site/jiraversions.py (original)
+++ comdev/reporter.apache.org/trunk/site/jiraversions.py Thu Sep  8 22:24:45 2016
@@ -6,7 +6,7 @@
    TODO: cache the LDAP query responses or use the appropriate json files instead
 """
 
-import os, sys, json, urllib2, re, time, base64, cgi, subprocess
+import os, sys, json, urllib2, re, time, base64, cgi, subprocess, calendar
 
 form = cgi.FieldStorage();
 user = os.environ['HTTP_X_AUTHENTICATED_USER'] if 'HTTP_X_AUTHENTICATED_USER' in os.environ
else None
@@ -72,7 +72,8 @@ if jiraname and user and (isMember(user)
         rdata = getReleaseData(project)
         for entry in cdata:
             if ('name' in entry and 'releaseDate' in entry and 'released' in entry and entry['released']):
-                date = time.mktime(time.strptime(entry['releaseDate'], "%Y-%m-%d"))
+                # force the use of UTC to avoid TZ issues; use float to agree with time.mktime
+                date = float(calendar.timegm(time.strptime(entry['releaseDate'], "%Y-%m-%d")))
                 if prepend:
                     entry['name'] = "%s-%s" % (prepend, entry['name'])
                 rdata[entry['name']] = date



Mime
View raw message