- 时间转时间戳的方法:
- NSString *timeSp = [NSString stringWithFormat:@"%d", (long)[datenow timeIntervalSince1970]];
- NSLog(@"timeSp:%@",timeSp); //时间戳的值
- 时间戳转时间的方法
- NSDate *confromTimesp = [NSDate dateWithTimeIntervalSince1970:1296035591];
- NSLog(@"1296035591 = %@",confromTimesp);
- NSString *confromTimespStr = [formatter stringFromDate:confromTimesp];
- NSLog(@"confromTimespStr = %@",confromTimespStr);
/
/