summaryrefslogtreecommitdiff
path: root/django/utils
diff options
context:
space:
mode:
authorRussell Keith-Magee <russell@keith-magee.com>2010-02-13 14:06:13 +0000
committerRussell Keith-Magee <russell@keith-magee.com>2010-02-13 14:06:13 +0000
commitd751f2cade81b6a8cf325ab5dd081c015f727ef3 (patch)
treeddc367c04b84f2e8c7aa1eb7c0078deaa8740959 /django/utils
parent1d9bc59534fd765f8ae1aeb4ca039899bc2b452b (diff)
[1.1.X] Fixed #12524 -- Clarified handling of pre-1000AD dates in datetime_safe (and thus, the serializers). Patch includes moving the datetime_safe tests into the utils regressiontests module. Thanks to gsf for the report and initial patch.
Backport of r12423 from trunk. git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.1.X@12424 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/utils')
-rw-r--r--django/utils/datetime_safe.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/django/utils/datetime_safe.py b/django/utils/datetime_safe.py
index a048ecd066..b634888092 100644
--- a/django/utils/datetime_safe.py
+++ b/django/utils/datetime_safe.py
@@ -4,7 +4,7 @@
#
# Based on code submitted to comp.lang.python by Andrew Dalke
#
-# >>> datetime_safe.date(1850, 8, 2).strftime("%Y/%M/%d was a %A")
+# >>> datetime_safe.date(1850, 8, 2).strftime("%Y/%m/%d was a %A")
# '1850/08/02 was a Friday'
from datetime import date as real_date, datetime as real_datetime
@@ -83,7 +83,7 @@ def strftime(dt, fmt):
sites.append(site)
s = s1
- syear = "%4d" % (dt.year,)
+ syear = "%04d" % (dt.year,)
for site in sites:
s = s[:site] + syear + s[site+4:]
return s