知道当前日期计算若干天后的日期

  NSDate *today = [[NSDate alloc] init];
    NSCalendar *cal = [[NSCalendar alloc] initWithCalendarIdentifier:NSCalendarIdentifierGregorian];
    NSDateComponents *components = [[NSDateComponents alloc] init];
    [components setDay:80];
    NSDate *endDay = [cal dateByAddingComponents:components toDate:today options:0];
    NSLog(@"%@",endDay);

posted @ 2015-04-23 11:06  Volley  阅读(368)  评论(0编辑  收藏  举报