类方法:
//时间戳转字符串
+(NSString *)getTimeString:(long int)time;
//时间戳转字符串
+(NSString *)getTimeString:(long int)time
{
NSTimeInterval timeInterval = time + 28800;
NSDate * date = [NSDate dateWithTimeIntervalSince1970:timeInterval];
NSDateFormatter * dateFormatter = [[NSDateFormatter alloc] init];
//设定时间格式,这里可以设置成自己需要的格式
[dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm"];
NSString * dateStr = [dateFormatter stringFromDate:date];
return dateStr;
}