在iphone编程中,如何计算两个NSDate之间的时间间隔呢?

我现在记下来:

timeIntervalSinceDate:

Returns the interval between the receiver and another given date.

- (NSTimeInterval)timeIntervalSinceDate:(NSDate *)anotherDate
 
NSTimeInterval返回的是一个double值,单位是秒
  • – timeIntervalSince1970 计算从1970年以来经过的timeInterval
  • – timeIntervalSinceNow 计算从现在
  •  

    相关文章:

    • 2022-12-23
    • 2022-12-23
    • 2021-09-19
    • 2022-01-26
    • 2022-12-23
    • 2022-12-23
    • 2021-12-09
    猜你喜欢
    • 2021-10-17
    • 2021-12-30
    • 2022-12-23
    • 2022-02-26
    • 2021-07-26
    • 2021-08-24
    • 2022-12-23
    相关资源
    相似解决方案