mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
gh-83861: Fix datetime.astimezone() method (GH-101545)
This commit is contained in:
parent
d4aa8578b1
commit
2b1260c557
4 changed files with 29 additions and 2 deletions
|
|
@ -6212,6 +6212,10 @@ class ZoneInfoTest(unittest.TestCase):
|
|||
ts1 = dt.replace(fold=1).timestamp()
|
||||
self.assertEqual(ts0, s0 + ss / 2)
|
||||
self.assertEqual(ts1, s0 - ss / 2)
|
||||
# gh-83861
|
||||
utc0 = dt.astimezone(timezone.utc)
|
||||
utc1 = dt.replace(fold=1).astimezone(timezone.utc)
|
||||
self.assertEqual(utc0, utc1 + timedelta(0, ss))
|
||||
finally:
|
||||
if TZ is None:
|
||||
del os.environ['TZ']
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue