diff options
| author | Jacob Kaplan-Moss <jacob@jacobian.org> | 2007-09-14 22:29:37 +0000 |
|---|---|---|
| committer | Jacob Kaplan-Moss <jacob@jacobian.org> | 2007-09-14 22:29:37 +0000 |
| commit | eb11615baa96bc53226d99819d6ac59b7154f9ab (patch) | |
| tree | 417c9baa4e521ffc44219c45ec144dd56704c04e | |
| parent | 27d027782cc1a99ad22105a39d3bab17ef871cf3 (diff) | |
Fixed number #4076: django.utils.feedgenerator now corectly handles times without timezones. Thanks, Alastair Tse.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6233 bcc190cf-cafb-0310-a4f2-bffc1f526a37
| -rw-r--r-- | django/utils/feedgenerator.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/django/utils/feedgenerator.py b/django/utils/feedgenerator.py index 6b6dedfbe9..44c96af147 100644 --- a/django/utils/feedgenerator.py +++ b/django/utils/feedgenerator.py @@ -27,7 +27,10 @@ def rfc2822_date(date): return email.Utils.formatdate(time.mktime(date.timetuple())) def rfc3339_date(date): - return date.strftime('%Y-%m-%dT%H:%M:%SZ') + if date.tzinfo: + return date.strftime('%Y-%m-%dT%H:%M:%S%z') + else: + return date.strftime('%Y-%m-%dT%H:%M:%SZ') def get_tag_uri(url, date): "Creates a TagURI. See http://diveintomark.org/archives/2004/05/28/howto-atom-id" |
