Python: Convert RFC 2822 string to datetime with timezone support

Since it's such a short snippet, I'll keep this post nice and simple.

from email.utils import parsedate_tz
print parsedate_tz('Fri, 15 May 2009 17:58:28 +0700')

That's it!

Source

 
Copyright © Twig's Tech Tips
Theme by BloggerThemes & TopWPThemes Sponsored by iBlogtoBlog