fix: datetime offsets
This commit is contained in:
parent
1d296f1a88
commit
9ed579fa35
@ -1943,6 +1943,8 @@ class _Timestamp(Timestamp):
|
|||||||
# manual epoch offset calulation to avoid rounding errors,
|
# manual epoch offset calulation to avoid rounding errors,
|
||||||
# to support negative timestamps (before 1970) and skirt
|
# to support negative timestamps (before 1970) and skirt
|
||||||
# around datetime bugs (apparently 0 isn't a year in [0, 9999]??)
|
# around datetime bugs (apparently 0 isn't a year in [0, 9999]??)
|
||||||
|
if dt.tzinfo is None:
|
||||||
|
dt = dt.replace(tzinfo=timezone.utc)
|
||||||
offset = dt - DATETIME_ZERO
|
offset = dt - DATETIME_ZERO
|
||||||
# below is the same as timedelta.total_seconds() but without dividing by 1e6
|
# below is the same as timedelta.total_seconds() but without dividing by 1e6
|
||||||
# so we end up with microseconds as integers instead of seconds as float
|
# so we end up with microseconds as integers instead of seconds as float
|
||||||
|
Loading…
x
Reference in New Issue
Block a user