diff --git a/django/utils/feedgenerator.py b/django/utils/feedgenerator.py
index 4175317..195a112 100644
a
|
b
|
import datetime
|
27 | 27 | import urlparse |
28 | 28 | from django.utils.xmlutils import SimplerXMLGenerator |
29 | 29 | from django.utils.encoding import force_unicode, iri_to_uri |
| 30 | from django.utils import datetime_safe |
30 | 31 | |
31 | 32 | def rfc2822_date(date): |
32 | 33 | # We do this ourselves to be timezone aware, email.Utils is not tz aware. |
33 | 34 | if date.tzinfo: |
34 | | time_str = date.strftime('%a, %d %b %Y %H:%M:%S ') |
| 35 | time_str = datetime_safe.new_date(date).strftime('%a, %d %b %Y %H:%M:%S ') |
35 | 36 | offset = date.tzinfo.utcoffset(date) |
36 | 37 | timezone = (offset.days * 24 * 60) + (offset.seconds / 60) |
37 | 38 | hour, minute = divmod(timezone, 60) |
38 | 39 | return time_str + "%+03d%02d" % (hour, minute) |
39 | 40 | else: |
40 | | return date.strftime('%a, %d %b %Y %H:%M:%S -0000') |
| 41 | return datetime_safe.new_date(date).strftime('%a, %d %b %Y %H:%M:%S -0000') |
41 | 42 | |
42 | 43 | def rfc3339_date(date): |
43 | 44 | if date.tzinfo: |
44 | | time_str = date.strftime('%Y-%m-%dT%H:%M:%S') |
| 45 | time_str = datetime_safe.new_date(date).strftime('%Y-%m-%dT%H:%M:%S') |
45 | 46 | offset = date.tzinfo.utcoffset(date) |
46 | 47 | timezone = (offset.days * 24 * 60) + (offset.seconds / 60) |
47 | 48 | hour, minute = divmod(timezone, 60) |
48 | 49 | return time_str + "%+03d:%02d" % (hour, minute) |
49 | 50 | else: |
50 | | return date.strftime('%Y-%m-%dT%H:%M:%SZ') |
| 51 | return datetime_safe.new_date(date).strftime('%Y-%m-%dT%H:%M:%SZ') |
51 | 52 | |
52 | 53 | def get_tag_uri(url, date): |
53 | 54 | """ |
diff --git a/tests/regressiontests/syndication/fixtures/feeddata.json b/tests/regressiontests/syndication/fixtures/feeddata.json
index 4a5c022..167115c 100644
a
|
b
|
|
4 | 4 | "pk": 1, |
5 | 5 | "fields": { |
6 | 6 | "title": "My first entry", |
7 | | "date": "2008-01-01 12:30:00" |
| 7 | "date": "1850-01-01 12:30:00" |
8 | 8 | } |
9 | 9 | }, |
10 | 10 | { |