计算两个NSDate之间的间隔

需要计算两个时间(NSDate类型)的时间间隔时,用下面函数 - (NSTimeInterval)timeIntervalSinceDate:(NSDate *)anotherDate   Returns the interval between the receiver and another given date.
- (NSTimeInterval)timeIntervalSinceDate:(NSDate *)anotherDate
 
NSTimeInterval返回的是一个double值,单位是秒
   

posted on 2012-11-15 14:18  流れ星ーー  阅读(181)  评论(0编辑  收藏  举报

导航