]> de.git.xonotic.org Git - xonotic/xonstat.git/blobdiff - xonstat/util.py
Implemented some (preliminary) JSON API to retrieve player data
[xonotic/xonstat.git] / xonstat / util.py
index f9aa1d5c07f96135f47cfdc71d2972bb3b693ec1..7c2692d45d51651605b2e78ba9ff98929fd7fd50 100644 (file)
@@ -151,3 +151,7 @@ def pretty_date(time=False):
         return "almost 2 years ago"
     else:
         return "about {0} years ago".format(int(round(dim/525600.0)))
+
+def datetime_seconds(td):
+    return float(td.microseconds + (td.seconds + td.days * 24 * 3600) * 10**6) / 10**6
+