title: python format datetime with "st", "nd", "rd", "th" (english ordinal suffix) like PHP's "S"
body: <p>I would like a python datetime object to output (and use the result in django) like this:</p>
  
  <pre><code>Thu the 2nd at 4:30
  </code></pre>
  
  <p>But I find no way in python to output <code>st</code>, <code>nd</code>, <code>rd</code>, or <code>th</code> like I can with PHP datetime format with the <code>S</code> string (What they call "English Ordinal Suffix") (<a href="http://uk.php.net/manual/en/function.date.php" rel="noreferrer">http://uk.php.net/manual/en/function.date.php</a>).</p>
  
  <p><strong>Is there a built-in way to do this in django/python?</strong> <code>strftime</code> isn't good enough (<a href="http://docs.python.org/library/datetime.html#strftime-strptime-behavior" rel="noreferrer">http://docs.python.org/library/datetime.html#strftime-strptime-behavior</a>).</p>
  
  <p>Django has a filter which does what I want, but I want a function, not a filter, to do what I want. Either a django or python function will be fine.</p>