NSArray *weekdayAry = [NSArray arrayWithObjects:@"星期日", @"星期一", @"星期二",@"星期三", @"星期四", @"星期五", @"星期六", nil];
NSDateFormatter *formater =[[NSDateFormatter alloc] init];
[formater setDateFormat:NSLocalizedString(@"yyyy-MM-dd EEEE",nil)];
[formater setShortWeekdaySymbols:weekdayAry];
[formater setLocale:[[NSLocale alloc]initWithLocaleIdentifier:@"zh_CN"]];//这里根据国家地区写Identifier,不写默认为英文
NSString *endStr= [formater stringFromDate:dateString];
时间: 2024-10-11 15:28:09