issue with date formatting using NSDateFormatter
问题 I have a date string which I want to convert to another format. The original date string example is : "2013-06-04 02:19:21 +0000" I want to convert this to "Wed, Jun 4" NSString * date_string = @"2013-06-04 02:19:21 +0000"; NSDateFormatter *complexdateFormater = [[NSDateFormatter alloc] init]; [complexdateFormater setDateFormat:@"yyyy-M-DD HH:mm:ss Z"]; NSDate* complexdate = [complexdateFormater dateFromString:date_string]; NSString *formatString = [NSDateFormatter dateFormatFromTemplate:@"EE