Created
October 28, 2011 09:55
-
-
Save plq/1321994 to your computer and use it in GitHub Desktop.
email date inconsistency
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 | |
import email.utils | |
import time | |
from datetime import datetime | |
a = datetime.now(pytz.utc) | |
print email.utils.formatdate(time.mktime(a.timetuple())) | |
print email.utils.formatdate(time.mktime(a.utctimetuple()) - time.timezone + 1e-6 * a.microsecond) | |
print repr(a) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
when i run this script i get:
I'm running Python 2.7.2 on gentoo linux. details are: