The django.utils.dateformat has a function format
that takes two arguments, the first one being the date (a datetime.date
[[or datetime.datetime
]] instance, where datetime
is the module in Python's standard library), the second one being the format string, and returns the resulting formatted string. The uppercase-S
format item (if part of the format string, of course) is the one that expands to the proper one of 'st', 'nd', 'rd' or 'th', depending on the day-of-month of the date in question.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…