标签:
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分
标签:
原文地址:http://www.cnblogs.com/aixixi/p/5159796.html