Skip to content

Instantly share code, notes, and snippets.

@jezdez
Created May 16, 2010 14:43
Show Gist options
  • Save jezdez/402905 to your computer and use it in GitHub Desktop.
Save jezdez/402905 to your computer and use it in GitHub Desktop.
diff --git a/django/utils/dateformat.py b/django/utils/dateformat.py
index 13cc2c7..efec5c3 100644
--- a/django/utils/dateformat.py
+++ b/django/utils/dateformat.py
@@ -128,7 +128,7 @@ class DateFormat(TimeFormat):
ISO 8601 Format
Example : '2008-01-02T10:30:00.000123'
"""
- return self.data.isoformat(' ')
+ return self.data.isoformat()
def d(self):
"Day of the month, 2 digits with leading zeros; i.e. '01' to '31'"
diff --git a/docs/ref/templates/builtins.txt b/docs/ref/templates/builtins.txt
index 24c0af5..393aab9 100644
--- a/docs/ref/templates/builtins.txt
+++ b/docs/ref/templates/builtins.txt
@@ -657,7 +657,7 @@ Available format strings:
A ``'AM'`` or ``'PM'``. ``'AM'``
b Month, textual, 3 letters, lowercase. ``'jan'``
B Not implemented.
- c ISO 8601 Format. ``2008-01-02 10:30:00.000123``
+ c ISO 8601 Format. ``2008-01-02T10:30:00.000123``
d Day of the month, 2 digits with ``'01'`` to ``'31'``
leading zeros.
D Day of the week, textual, 3 letters. ``'Fri'``
diff --git a/tests/regressiontests/dateformat/tests.py b/tests/regressiontests/dateformat/tests.py
index 42c582c..545b17d 100644
--- a/tests/regressiontests/dateformat/tests.py
+++ b/tests/regressiontests/dateformat/tests.py
@@ -42,7 +42,7 @@ class DateFormatTests(TestCase):
timestamp = datetime.datetime(2008, 5, 19, 11, 45, 23, 123456)
self.assertEquals(dateformat.format(my_birthday, 'A'), u'PM')
- self.assertEquals(dateformat.format(timestamp, 'c'), u'2008-05-19 11:45:23.123456')
+ self.assertEquals(dateformat.format(timestamp, 'c'), u'2008-05-19T11:45:23.123456')
self.assertEquals(dateformat.format(my_birthday, 'd'), u'08')
self.assertEquals(dateformat.format(my_birthday, 'j'), u'8')
self.assertEquals(dateformat.format(my_birthday, 'l'), u'Sunday')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment