NSDateFormatter设定日期格式 AM
2017-02-16 本文已影响23人
三岁就很乖
NSDateFormatter * dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setAMSymbol:@"AM"];
[dateFormatter setPMSymbol:@"PM"];
[dateFormatter setDateFormat:@"dd/MM/yyyy hh:mmaaa"];
NSDate *date = [NSDate date];
NSString *s = [dateFormatter stringFromDate:date];