Created
June 17, 2024 15:49
-
-
Save jaraco/624a01514f34159315b42ad62d870d7e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~ @ pip-run pytz -- -q | |
>>> import pytz | |
>>> import datetime | |
>>> est = pytz.timezone('US/Eastern') | |
>>> datetime.datetime(2018, 3, 11, 9, 0, 0).replace(tzinfo=est) - datetime.datetime(2018, 3, 10, 9, 0, 0).replace(tzinfo=est) | |
datetime.timedelta(days=1) | |
>>> est.localize(datetime.datetime(2018, 3, 11, 9, 0, 0)) - est.localize(datetime.datetime(2018, 3, 10, 9, 0, 0)) | |
datetime.timedelta(seconds=82800) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment