summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTong Li <litong01@us.ibm.com>2016-02-12 14:44:52 -0500
committerTong Li <litong01@us.ibm.com>2016-02-12 14:44:52 -0500
commitd8f3f770e489e50f708cb6fb90cd88173f3cb5c3 (patch)
tree89c16aa510df1f42b28ef086eee0250e6b01b0f0
parentb93ded41ed4150468f210154c569b258411685d4 (diff)
ES now returns timestamp as milliseconds vs seconds
Notes
Notes (review): Code-Review+2: litong01 <litong01@us.ibm.com> Workflow+1: litong01 <litong01@us.ibm.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Sat, 13 Feb 2016 04:38:06 +0000 Reviewed-on: https://review.openstack.org/279749 Project: openstack/kiloeyes Branch: refs/heads/master
-rwxr-xr-xkiloeyes/common/timeutils.py2
1 files changed, 2 insertions, 0 deletions
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():
115 115
116def iso8601_from_timestamp(timestamp): 116def iso8601_from_timestamp(timestamp):
117 """Returns an iso8601 formatted date from timestamp.""" 117 """Returns an iso8601 formatted date from timestamp."""
118 if timestamp > 1000000000000:
119 timestamp = timestamp / 1000
118 return isotime(datetime.datetime.utcfromtimestamp(timestamp)) 120 return isotime(datetime.datetime.utcfromtimestamp(timestamp))
119 121
120 122