0
所以在我的应用程序我想减去两个日期。第一个日期是设置日期,第二个日期是当前日期。所以我试过这个代码:NSDate减去麻烦
NSString *setDateString = [NSString stringWithFormat:@"12:30"];
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
NSDate *setDate = [dateFormatter dateFromString:setDateString];
NSTimeInterval interval = [[NSDate date] timeIntervalSinceDate:setDate];
但它计数从1970年的时间间隔。但我需要从当前的日子。谁能帮忙?