Bläddra i källkod

tau: fix datetime if the timestamp is in millis

dasman 1 år sedan
förälder
incheckning
eeddb7ef8c
1 ändrade filer med 3 tillägg och 1 borttagningar
  1. 3 1
      bin/tau/tau-python/lib/util.py

+ 3 - 1
bin/tau/tau-python/lib/util.py

@@ -22,7 +22,9 @@ def month_to_unix(month=None):
     return unix
 
 def unix_to_datetime(timestamp):
-    return datetime.fromtimestamp(int(timestamp), UTC)
+    timestamp = int(timestamp)
+    ts = timestamp if timestamp < 1e10 else timestamp/1000
+    return datetime.fromtimestamp(ts, UTC)
 
 task_template = {
     "workspace": str,