~ubuntu-branches/ubuntu/natty/python-django/natty-security

« back to all changes in this revision

Viewing changes to django/utils/datetime_safe.py

  • Committer: Bazaar Package Importer
  • Author(s): Chris Lamb
  • Date: 2010-05-21 07:52:55 UTC
  • mfrom: (1.1.10 upstream) (4.4.7 sid)
  • Revision ID: james.westby@ubuntu.com-20100521075255-i1zpeyc0k8512pd7
Tags: 1.2-1
New upstream stable release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
#
5
5
# Based on code submitted to comp.lang.python by Andrew Dalke
6
6
#
7
 
# >>> datetime_safe.date(1850, 8, 2).strftime("%Y/%M/%d was a %A")
 
7
# >>> datetime_safe.date(1850, 8, 2).strftime("%Y/%m/%d was a %A")
8
8
# '1850/08/02 was a Friday'
9
9
 
10
10
from datetime import date as real_date, datetime as real_datetime
83
83
            sites.append(site)
84
84
 
85
85
    s = s1
86
 
    syear = "%4d" % (dt.year,)
 
86
    syear = "%04d" % (dt.year,)
87
87
    for site in sites:
88
88
        s = s[:site] + syear + s[site+4:]
89
89
    return s