views:

48

answers:

0

I'm trying to use only a NSDateFormatter to format string representation of a date/time to an NSDate object. The issue is that I can't figure out how to allow the ordinal suffixes in the format.

So lets say I have a string "Wednesday, August 11th 2010 8:00 PM"

What one line NSDate dateFormat should I use?

Like "EEEE, MMM dd'th' yyyy h:mm a" would work, but that will only work for ordinal days ending in 'th', whereas i need a single format that will allow for 1st, 2nd, 3rd, 4th 5th etc.

It seems like a wildcard character in the format string to accomplish this. I've tried a few things like: % * ?