Enough of the following: NSDateFormatter by default has a default standard for the phone:
NSDate *date = [NSDate date]; NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; [dateFormatter setTimeStyle:NSDateFormatterShortStyle]; [dateFormatter setDateStyle:NSDateFormatterShortStyle]; NSLog(@"%@",[dateFormatter stringFromDate:date]);
FYI here, what happens to the USA, the Netherlands and Sweden:
[dateFormatter setLocale:[[NSLocale alloc] initWithLocaleIdentifier:@"en_US"]]; NSLog(@"%@",[dateFormatter stringFromDate:date]); // displays 10/30/11 7:09 PM [dateFormatter setLocale:[[NSLocale alloc] initWithLocaleIdentifier:@"nl_NL"]]; NSLog(@"%@",[dateFormatter stringFromDate:date]); // displays 30-10-11 19:09 [dateFormatter setLocale:[[NSLocale alloc] initWithLocaleIdentifier:@"sv_SE"]]; NSLog(@"%@",[dateFormatter stringFromDate:date]); // displays 2011-10-30 19:09
yuji
source share