I am using NSDateFormatter to set my date in my iPhone app, and dates are showing up properly. However, I am finding all the locales (my app supports up to 12 different lan
Self-contained solution with @fbrereto's design:
static NSString *FormatDate(NSDate *date) { return [NSDateFormatter localizedStringFromDate:date dateStyle:NSDateFormatterMediumStyle timeStyle:NSDateFormatterNoStyle]; }
Now you can simply run:
NSString *formattedDate = FormatDate([NSDate new]);