We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 2928bfc + 742bd08 commit 777c6acCopy full SHA for 777c6ac
gcloud/bigquery/_helpers.py
@@ -42,8 +42,12 @@ def _datetime_from_prop(value):
42
"""
43
if value is not None:
44
# back-end returns timestamps as milliseconds since the epoch
45
- value = datetime.datetime.utcfromtimestamp(value / 1000.0)
46
- return value.replace(tzinfo=pytz.utc)
+ seconds = int(value / 1000.0)
+ microseconds = 1000.0 * (value - 1000 * seconds)
47
+ return (
48
+ _EPOCH +
49
+ datetime.timedelta(seconds=seconds, microseconds=microseconds)
50
+ )
51
52
53
def _prop_from_datetime(value):
0 commit comments