首页 > 代码库 > iOS 日期比较

iOS 日期比较

这里记录一下iOS中日期比较的方法

NSDate * now = [NSDate date];
    NSDate * beforetime = [now dateByAddingTimeInterval:-60];
    NSTimeInterval timeBetween = [now timeIntervalSinceDate:beforetime];
    NSLog(@"%f",timeBetween);


iOS 日期比较