//服务器返回10位格式时间戳利用如下方法将时间戳转换成字符串的时间格式
NSDateFormatter* formatter = [[NSDateFormatter alloc] init];
[formatter setDateFormat:@"YYYY-MM-dd HH:mm:ss"];
NSTimeInterval timeinterval =[[[posts_array objectAtIndex:indexPath.row]valueForKey:@"dateline"] doubleValue];
NSDate *date = [NSDate dateWithTimeIntervalSince1970:timeinterval];
NSString *timeString = [formatter stringFromDate:date];
转载于:https://blog.51cto.com/yang120jun/1087570