Skip to content

Loading…

cube-client is sending times in local time, but cube is expecting UTC #1

Merged
merged 2 commits into from

2 participants

@aaronsw

No description provided.

@tsileo tsileo merged commit 1393f4f into tsileo:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 1, 2012
  1. @aaronsw

    Fix typo

    aaronsw committed
  2. @aaronsw

    Fix time zone bug

    aaronsw committed
This page is out of date. Refresh to see the latest.
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")
Something went wrong with that request. Please try again.