ios 时间和毫秒数转换

时间:2015-07-03 06:48:53   收藏:0   阅读:350

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

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

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

原文:http://www.cnblogs.com/tangranyang/p/4617515.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!