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.
1 parent 9a0d113 commit d0367ffCopy full SHA for d0367ff
bson/datetime_ms.py
@@ -126,7 +126,7 @@ def _min_datetime_ms(tz: datetime.timezone = datetime.timezone.utc) -> int:
126
try:
127
dtm = _MIN_UTC.astimezone(tz)
128
except OverflowError:
129
- dtm = (_MIN_UTC - tz.utcoffset(_MIN_UTC)).astimezone(tz)
+ dtm = _MIN_UTC.replace(tzinfo=tz)
130
return _datetime_to_millis(dtm)
131
132
@@ -135,7 +135,7 @@ def _max_datetime_ms(tz: datetime.timezone = datetime.timezone.utc) -> int:
135
136
dtm = _MAX_UTC.astimezone(tz)
137
138
- dtm = (_MAX_UTC - tz.utcoffset(_MAX_UTC)).astimezone(tz)
+ dtm = _MAX_UTC.replace(tzinfo=tz)
139
140
141
0 commit comments