From d8f3f770e489e50f708cb6fb90cd88173f3cb5c3 Mon Sep 17 00:00:00 2001 From: Tong Li Date: Fri, 12 Feb 2016 14:44:52 -0500 Subject: [PATCH] ES now returns timestamp as milliseconds vs seconds Change-Id: I54e3abb2d2547b97423fe512221d32f0ec74a8ff --- kiloeyes/common/timeutils.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kiloeyes/common/timeutils.py b/kiloeyes/common/timeutils.py index c48da95..0beda4c 100755 --- a/kiloeyes/common/timeutils.py +++ b/kiloeyes/common/timeutils.py @@ -115,6 +115,8 @@ def utcnow(): def iso8601_from_timestamp(timestamp): """Returns an iso8601 formatted date from timestamp.""" + if timestamp > 1000000000000: + timestamp = timestamp / 1000 return isotime(datetime.datetime.utcfromtimestamp(timestamp))