Commits

Anonymous committed 3378b67

Fixed #13547 -- Made sure the ISO 8601 date formatting introduced in r12058 uses "T" as the separator between the date and the time value to increase real world usefulness.

While the ISO standard permits the use of a space instead of "T" for readability, it does have an impact on standards like HTML5 which rely on specific rules made in RFC 3339.

Comments (0)

Files changed (3)

django/utils/dateformat.py

         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'"

docs/ref/templates/builtins.txt

     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'``

tests/regressiontests/dateformat/tests.py

         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')
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.