Ticket #12109: dateformat.patch

File dateformat.patch, 928 bytes (added by charlieman, 15 years ago)
  • django/utils/dateformat.py

     
    1919from django.utils.translation import ugettext as _
    2020from django.utils.encoding import force_unicode
    2121
    22 re_formatchars = re.compile(r'(?<!\\)([aAbBdDfFgGhHiIjlLmMnNOPrsStTUwWyYzZ])')
     22re_formatchars = re.compile(r'(?<!\\)([aAbBcdDfFgGhHiIjlLmMnNOPrsStTUwWyYzZ])')
    2323re_escaped = re.compile(r'\\(.)')
    2424
    2525class Formatter(object):
     
    118118        "Month, textual, 3 letters, lowercase; e.g. 'jan'"
    119119        return MONTHS_3[self.data.month]
    120120
     121    def c(self):
     122        "ISO 8601 date; i.e 2004-02-12T15:19:21+00:00"
     123        return u'%s' % self.data.isoformat()
     124
    121125    def d(self):
    122126        "Day of the month, 2 digits with leading zeros; i.e. '01' to '31'"
    123127        return u'%02d' % self.data.day
Back to Top