/ Published in: Python
like PHP's 'jS'
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
if 4 <= day <= 20 or 24 <= day <= 30: suffix = "th" else: suffix = ["st", "nd", "rd"][day % 10 - 1]
URL: http://mail.python.org/pipermail/python-list/2005-July/333218.html