Created
February 6, 2020 16:25
-
-
Save davidmezzetti/32eca7f8750f40e482e10a4b3e37e997 to your computer and use it in GitHub Desktop.
This file contains 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
>>> import pytz | |
>>> from pytz import timezone | |
>>> utc = pytz.utc | |
>>> eastern = timezone('US/Eastern') | |
>>> date = datetime.utcnow().astimezone(utc) | |
>>> date | |
datetime.datetime(2020, 2, 6, 21, 22, 49, 384018, tzinfo=<UTC>) | |
>>> date.astimezone(eastern) | |
datetime.datetime(2020, 2, 6, 16, 22, 49, 384018, tzinfo=<DstTzInfo 'US/Eastern' EST-1 day, 19:00:00 STD>) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment