调用以下方法即可
-(NSString *)dateWithString:(NSString *)string{
/**
设置你想要的时间格式
*/
NSDateFormatter * fotmatter = [[NSDateFormatteralloc]init];
[fotmatter setDateStyle:NSDateFormatterMediumStyle];
[fotmatter setTimeStyle:NSDateFormatterShortStyle];
//
[fotmatter setDateFormat:@"YYYY-MM-dd HH:mm:ss"];
//n
NSTimeInterval time = [string doubleValue];
NSDate * date = [NSDatedateWithTimeIntervalSince1970:time];
NSString * currentString = [fotmatter stringFromDate:date];
return currentString;
}