NSDate *date = [NSDate date];
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
formatter.AMSymbol = @"AM";
formatter.PMSymbol = @"PM";
formatter.dateFormat = @"yyyy-MM-dd hh:mm:ss a”; // hh 是十二小时制,HH 二十四小时制 注意后面加的字母a
NSString *ff = [formatter stringFromDate:date];