]> de.git.xonotic.org Git - xonotic/xonstat.git/commitdiff
Convert using the given epoch value (to UTC time)
authorAnt Zucaro <azucaro@gmail.com>
Sun, 15 May 2011 00:11:35 +0000 (20:11 -0400)
committerAnt Zucaro <azucaro@gmail.com>
Sun, 15 May 2011 00:11:35 +0000 (20:11 -0400)
xonstat/views.py

index 0c9d74590091a3045eb2c27cd4236d212847153e..cf4a43eac6c2264474f8f5441ebdc0ddeceb1569 100755 (executable)
@@ -1,4 +1,5 @@
 import datetime
+import time
 import re
 from pyramid.response import Response
 from pyramid.view import view_config
@@ -404,8 +405,9 @@ def stats_submit(request):
         else:
             winner = None
 
-        # FIXME: don't use python now() here, convert from epoch T value
-        game = create_game(session=session, start_dt=datetime.datetime.now(), 
+        game = create_game(session=session, 
+                start_dt=datetime.datetime(
+                    *time.gmtime(float(game_meta['T']))[:6]), 
                 server_id=server.server_id, game_type_cd=game_meta['G'], 
                 map_id=gmap.map_id, winner=winner)