If it would be possible to post long comments in readable form, I would comment on Madhups answer.
So here is my comment:
The bad thing with these custom date formats is that if you are not from the United States or another country that uses the same date as the date is incorrect.
Here is how your solution will look on my device: Freitag, Februar 18th
My mom will say th ? What does it mean?
And I would say: "Another developer who never left his country."
Please I want my date to be like this: Freitag, 18. Februar
Because that's what I'm used to. Here's what the date should look like.
please add a check that uses only personalized date formats if the current locale is similar to the custom date format you are using.
In iOS4, Apple introduced a really cool method.
+ (NSString *)dateFormatFromTemplate:(NSString *)template options:(NSUInteger)opts locale:(NSLocale *)locale
you pass this method to each component that you want in your dateformat format, and you return a format that uses the locale.
So, if you want to use a weekday, day, and month, you will use something like this:
NSString *localizedDateFormat = [NSDateFormatter dateFormatFromTemplate:@"EEEE MMMM d" options:0 locale:[NSLocale currentLocale]];
and he will return EEEE, d. MMMM EEEE, d. MMMM for German locale. Or EEEE, MMMM d for our locale. Then you can use this to set a custom dateFormat.
This is the whole point of NSDateFormatter. Localized dates. If you use [dateFormatter setDateFormat:@"some hard coded date format"] to display dates to the user, you are doing it wrong in most cases.
I really hate apps that combine date style and German date style.