NSString *dataStr = @"1453709220";
double lastactivityInterval = [model.addtime doubleValue];
NSDateFormatter* formatter = [[NSDateFormatter alloc] init];
formatter.timeZone = [NSTimeZone timeZoneWithName:@"beijing"];
[formatter setDateStyle:NSDateFormatterMediumStyle];
[formatter setTimeStyle:NSDateFormatterShortStyle];
[formatter setDateFormat:@"yyyy年MM月dd日 HH时mm分"];
NSDate* date = [NSDate dateWithTimeIntervalSince1970:lastactivityInterval];
NSString* dateString = [formatter stringFromDate:date];
NSLog(@"format dateString:%@",dateString);
打印结果是:2016年01月25日 16时07分
时间: 2024-10-18 16:43:14