Skip to content

Instantly share code, notes, and snippets.

@jaraco
Created June 17, 2024 15:49
Show Gist options
  • Save jaraco/624a01514f34159315b42ad62d870d7e to your computer and use it in GitHub Desktop.
Save jaraco/624a01514f34159315b42ad62d870d7e to your computer and use it in GitHub Desktop.
~ @ 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