Ticket #10866: datetime_safe_zero_padding.2.diff
File datetime_safe_zero_padding.2.diff, 791 bytes (added by , 16 years ago) |
---|
-
django/utils/datetime_safe.py
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 -
tests/regressiontests/datetime_safe/tests.py
34 34 '00' 35 35 >>> datetime(*just_safe).strftime('%y') 36 36 '00' 37 >>> datetime(*really_old).strftime('%Y') 38 '0020' 37 39 """