Skip to content

Commit

Permalink
Merge pull request lebauce#26 from bullno1/patch-1
Browse files Browse the repository at this point in the history
Consider timezone when parsing docker's timestamp
  • Loading branch information
lebauce authored Jan 10, 2019
2 parents ff503a3 + ca7db7f commit cd0257a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion dockerplugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

import dateutil.parser
from distutils.version import StrictVersion
import calendar
import docker
import os
import threading
Expand Down Expand Up @@ -58,7 +59,7 @@ def emit(cls, container, type, value, t=None, type_instance=None):
val.type_instance = type_instance

if t:
val.time = time.mktime(dateutil.parser.parse(t).timetuple())
val.time = calendar.timegm(dateutil.parser.parse(t).utctimetuple())
else:
val.time = time.time()

Expand Down

0 comments on commit cd0257a

Please sign in to comment.