Test Header HTML Code

IPhone判断时间间隔

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

我现在记下来:

timeIntervalSinceDate:

Returns the interval between the receiver and another given date.

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

    posted on 2010-11-15 20:07  宁静的水泡  阅读(2614)  评论(0)    收藏  举报

    导航

    Test Rooter HTML Code