Ticket #12524: safe_year.diff

File safe_year.diff, 415 bytes (added by Gabriel Farrell, 15 years ago)

Fill zeros on string-formatted years

  • django/utils/datetime_safe.py

     
    8383            sites.append(site)
    8484
    8585    s = s1
    86     syear = "%4d" % (dt.year,)
     86    syear = "%04d" % (dt.year,)
    8787    for site in sites:
    8888        s = s[:site] + syear + s[site+4:]
    8989    return s
Back to Top