OC获取当天0点方法

- (NSDate*)getZeroToday{

NSCalendar *calendar = [NSCalendar currentCalendar];

NSDate *now = [NSDate date];

NSDateComponents *components = [calendar components:NSCalendarUnitYear|NSCalendarUnitMonth|NSCalendarUnitDay fromDate:now];

NSDate *startDate = [calendar dateFromComponents:components];

return startDate;

}

你可能感兴趣的:(OC获取当天0点方法)