秒数换成标准时间,从1970年开始
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
[formatter setDateFormat:@"yyyy年MM月dd日 HH:mm:ss"];
NSString *dateLoca = [NSString stringWithFormat:@"%@",!@“你的秒数”];
NSTimeInterval time=[dateLoca doubleValue];
NSDate *detaildate=[NSDate dateWithTimeIntervalSince1970:time];
NSString *timestr = [formatter stringFromDate:detaildate];
时间换成秒数,从1970年到你需要的时间 10位
NSTimeInterval time=[[NSDate date]timeIntervalSince1970];
long long int nowDate=(long long int)time;
NSString *timeStr=[NSString stringWithFormat:@"%lli",nowDate];
NSLog(@"second is %@",timeStr);