What setDateFormat option for NSDateFormatter do I use to get a month-day's ordinal suffix?
e.g. the snippet below currently produces:
3:11 PM Saturday August 15
What must I change to get:
3:11 PM Saturday August 15**th**
NSDate *date = [NSDate date];
NSDateFormatter *dateFormatter = [[[NSDateFormatter alloc] init] autorelease];
[dateFormatter setFormatterBehavior:NSDateFormatterBehavior10_4];
[dateFormatter setDateFormat:@"h:mm a EEEE MMMM d"];
NSString *dateString = [dateFormatter stringFromDate:date];
NSLog(@"%@", dateString);
In PHP, I'd use this for the case above:
<?php echo date('h:m A l F jS') ?>
Is there an NSDateFormatter equivalent to the S option in the PHP formatting string?