File tree Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -339,9 +339,9 @@ def convert_filters(filters):
339
339
return json .dumps (result )
340
340
341
341
342
- def datetime_to_timestamp (dt = datetime . now () ):
343
- """Convert a datetime in local timezone to a unix timestamp"""
344
- delta = dt - datetime .fromtimestamp (0 )
342
+ def datetime_to_timestamp (dt ):
343
+ """Convert a UTC datetime to a Unix timestamp"""
344
+ delta = dt - datetime .utcfromtimestamp (0 )
345
345
return delta .seconds + delta .days * 24 * 3600
346
346
347
347
Original file line number Diff line number Diff line change @@ -251,8 +251,8 @@ function return a blocking generator you can iterate over to retrieve events as
251
251
252
252
** Params** :
253
253
254
- * since (datetime or int): get events from this point
255
- * until (datetime or int): get events until this point
254
+ * since (UTC datetime or int): get events from this point
255
+ * until (UTC datetime or int): get events until this point
256
256
* filters (dict): filter the events by event time, container or image
257
257
* decode (bool): If set to true, stream will be decoded into dicts on the
258
258
fly. False by default.
Original file line number Diff line number Diff line change @@ -221,7 +221,7 @@ def test_events(self):
221
221
222
222
def test_events_with_since_until (self ):
223
223
ts = 1356048000
224
- now = datetime .datetime .fromtimestamp (ts )
224
+ now = datetime .datetime .utcfromtimestamp (ts )
225
225
since = now - datetime .timedelta (seconds = 10 )
226
226
until = now + datetime .timedelta (seconds = 10 )
227
227
try :
You can’t perform that action at this time.
0 commit comments