Time formatting and date suffixes

Jeffrey E. Forcier jforcier at strozllc.com
Mon Jul 25 18:47:05 EDT 2005


This seems like a dead simple question, as it's so rudimentary I  
can't believe it hasn't been addressed before. I'm using the  
time.strftime() function (actually the mxDateTime implementation, but  
they're compatible so it shouldn't matter) to spit out fairly basic  
date formats, to wit:

January 25th, 2005

The various and sundry date objects in both mxDateTime and Python  
proper's time/datetime don't seem to have anything anywhere dealing  
with the 'th' suffix on the date. So in other words, I can use  
strftime() to get 'January 25, 2005' but don't see anything dealing  
with outputting the suffixes like 'th', 'nd' and the like. Googling  
around and searching this list's archives aren't turning anything up,  
either.

Am I missing something obvious, or is it just really, really frowned  
upon to use such a locale-specific function as English date suffixes?

Thanks,
Jeff

--
Jeffrey E. Forcier
Junior Developer, Research and Development
Stroz Friedberg, LLC
15 Maiden Lane, 12th Floor
New York, NY 10038
[main]212-981-6540 [direct]212-981-6546
http://www.strozllc.com

This message is for the named person's use only.  It may contain
confidential, proprietary or legally privileged information. No right to
confidential or privileged treatment of this message is waived or lost
by any error in transmission.  If you have received this message in
error, please immediately notify the sender by e-mail or by telephone at
212.981.6540, delete the message and all copies from your system and
destroy any hard copies.  You must not, directly or indirectly, use,
disclose, distribute, print or copy any part of this message if you are
not the intended recipient.




More information about the Python-list mailing list