现在的位置: 首页 > 综合 > 正文

NSTimeInterval 的使用

2018年09月09日 ⁄ 综合 ⁄ 共 297字 ⁄ 字号 评论关闭

NSTimeInterval sec= [[NSDate date] timeIntervalSince1970]; 可以这样定义

NSLog(@"当前时间为%f", time);  打印出从1970年开始到现在的秒数.

 NSTimeInterval sec = [self.lastUpDate timeIntervalSinceNow];

 NSTimeInterval sec = [self.lastUpDate timeIntervalSinceReferenceDate];

NSTimeInterval sec = [self.lastUpDate timeIntervalSinceDate:<#(NSDate *)#>];

抱歉!评论已关闭.