Skip to content

Commit

Permalink
fix(stackdriver): fix millis_to_time so it works on developer machine…
Browse files Browse the repository at this point in the history
…s that use localized time. (#219)

The tests were passing in CI but failing locally. Ensuring the timestamp is using UTC instead of localized time fixes the inconsistency.
  • Loading branch information
jwelch92 authored and plumpy committed Sep 18, 2019
1 parent 922385d commit acb2028
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,8 @@ class GoogleMonitoringService(object):

@staticmethod
def millis_to_time(millis):
return datetime.fromtimestamp(millis // 1000).isoformat('T') + 'Z'
# matches expected format StackdriverSurveyor.__date_format = '%Y-%m-%dT%H:%M:%SZ'
return datetime.utcfromtimestamp(millis // 1000).strftime("%Y-%m-%dT%H:%M:%SZ")

@property
def project(self):
Expand Down

0 comments on commit acb2028

Please sign in to comment.