NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar]; NSDateComponents *comps = nil; NSDate*nowDate = [NSDate dateWithString:self.timeStamp formatterString:@"yyyy-MM"]; comps = [calendar components:NSYearCalendarUnit|NSMonthCalendarUnit|NSDayCalendarUnit fromDate:nowDate]; NSDateComponents *adcomps = [[NSDateComponents alloc] init]; [adcomps setMonth:-1]; NSDate *newdate = [calendar dateByAddingComponents:adcomps toDate:nowDate options:0];