标签:
//
// 时间的秒值和正常的时间格式转换.h
// IOS笔记
//
// Created by 刘威成 on 15/12/8.
// All rights reserved.
//
// TargetTime是获取时间的秒值转换成我们常见的时间格式
for (int i = 0; i <dataArr.count; i++) {
NSString *str = [ NSString stringWithFormat:@"%@",[dataArr objectAtIndex:i][@"addTime"]];
long long int date = (long long int)[str intValue];
NSDate *dates = [NSDate dateWithTimeIntervalSince1970:date];
NSDateFormatter *formatter = [[NSDateFormatter alloc]init];
[formatter setDateFormat:@"yyyy年MM月dd日 h:MM:ss"];
NSString *targetTIme = [formatter stringFromDate:dates];
DLog("%@",targetTIme);
DLog("%@",[dataArr objectAtIndex:i][@"remark"]);
//获取当前时间的秒值
NSTimeInterval time = [[NSDate date]timeIntervalSince1970];
long i = time;
NSString *paramTime = [NSString stringWithFormat:@"%ld",i];
标签:
原文地址:http://www.cnblogs.com/er-dai-ma-nong/p/5045697.html