Last active
August 29, 2015 14:20
-
-
Save nsfyn55/c1ca64e580f60a3f78a3 to your computer and use it in GitHub Desktop.
Convert Timezone Aware Date to Timezone unaware UTC Equivalent
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
from dateutil.parser import parse | |
from pytz import utc | |
datestr = 'Fri, 24 Apr 2015 14:49:32 -0400' | |
dt = parse(datestr) | |
utc_dt = dt.astimezone(utc) | |
final = utc_dt.replace(tzinfo=None) |
Author
nsfyn55
commented
May 1, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment