//判断是否是多少秒前
-
(BOOL)isBefore:(NSString *)dateString gap:(NSTimeInterval)timeInterval
{
NSDate *date = [NSDate dateWithTimeIntervalSince1970:[dateString doubleValue]/1000];
return [self isBeforeWithDate:date gap:timeInterval];
} -
(BOOL)isBeforeWithDate:(NSDate *)date gap:(NSTimeInterval)timeInterval
{
NSDate *tenMinut = [NSDate dateWithTimeIntervalSinceNow:timeInterval];NSComparisonResult result = [date compare:tenMinut];
if (result == NSOrderedDescending) {
return NO;
}
return YES;
}
网友评论