ios 时间和毫秒数转换

01-时间和毫秒数的相互转换

//获取毫秒数的时间戳
long inter = [[NSDate date] timeIntervalSince1970]*1000; NSLog(@"%ld",inter);

//把毫秒数转换成时间
NSDate *date = [NSDate dateWithTimeIntervalSince1970:inter/1000]; NSLog(@"%@",date); 

原文地址:https://www.cnblogs.com/tangranyang/p/4617515.html