Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #1 from aaronsw/master

cube-client is sending times in local time, but cube is expecting UTC
  • Loading branch information...
commit 1393f4f97e73033efb7a4f70ded4b2d513cb1aef 2 parents e9b3467 + 580bb14
@tsileo authored
Showing with 3 additions and 3 deletions.
  1. +1 −1  README.rst
  2. +2 −2 cube.py
View
2  README.rst
@@ -72,7 +72,7 @@ Usage
# Create an event
cube.put("myevent", {"temp": 30})
# or
- cube.put("myvent", {"temp": 30}, time=datatime.now().isoformat())
+ cube.put("myevent", {"temp": 30}, time=datatime.now().isoformat())
# Request events data
# See Cube queries:
View
4 cube.py
@@ -17,7 +17,7 @@ def put(self, event_type, event_data={}, **kwargs):
"""
event = dict(type=event_type, data=event_data)
- event["time"] = kwargs.get("time", datetime.now().isoformat())
+ event["time"] = kwargs.get("time", datetime.utcnow().isoformat())
if kwargs.get("id"):
event["id"] = kwargs.get("id")
@@ -32,7 +32,7 @@ def put(self, event_type, event_data={}, **kwargs):
def make_query(self, query_type, expression, **kwargs):
data = dict(expression=expression,
- stop=kwargs.get("stop", datetime.now().isoformat()))
+ stop=kwargs.get("stop", datetime.utcnow().isoformat()))
if kwargs.get("start"):
data["start"] = kwargs.get("start")
Please sign in to comment.
Something went wrong with that request. Please try again.