homepage

This issue tracker has been migrated to GitHub , and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author burak.arslan
Recipients burak.arslan
Date 2011年10月28日.12:06:34
SpamBayes Score 9.890443e-05
Marked as misclassified No
Message-id <1319803595.43.0.202651684081.issue13284@psf.upfronthosting.co.za>
In-reply-to
Content
turns out timetuple was not passing timezone information. the correct way of converting a datetime.datetime object to a correct rfc-2822 compliant date string seems to be:
email.utils.formatdate(time.mktime(a.utctimetuple()) + 1e-6 * a.microsecond - time.timezone)
what a mess. if the above is indeed the right way to do this, is it possible to add the following function to the email.utils module?
def formatdatetime(dt_object):
 return email.utils.formatdate(time.mktime(dt_object.utctimetuple()) + 1e-6 * a.microsecond - time.timezone)
this works for datetime instances both with and without time zone information.
ps: i updated the code in the github link but not here.
History
Date User Action Args
2011年10月28日 12:06:35burak.arslansetrecipients: + burak.arslan
2011年10月28日 12:06:35burak.arslansetmessageid: <1319803595.43.0.202651684081.issue13284@psf.upfronthosting.co.za>
2011年10月28日 12:06:34burak.arslanlinkissue13284 messages
2011年10月28日 12:06:34burak.arslancreate

AltStyle によって変換されたページ (->オリジナル) /