how to calculate the age based on the birth date in this format 6/24/1976 mon/date/year...
-(NSInteger) ComputeYearMonth
{
NSDateFormatter *format = [[NSDateFormatter alloc] init];
[format setDateFormat:@"yyyy-MM-dd"];
NSDate *DateOfBirth=[format dateFromString:[NSString stringWithFormat:@"%@-%@-%@",year,month,day]];
NSDate *currentTime = [NSDate date];
NSLog(@"DateOfBirth======%@",DateOfBirth);
NSInteger years = [[[NSCalendar currentCalendar] components:NSYearCalendarUnit
fromDate:DateOfBirth
toDate:currentTime options:0]year];
NSInteger months = [[[NSCalendar currentCalendar] components:NSMonthCalendarUnit
fromDate:DateOfBirth
toDate:currentTime options:0]month];
NSLog(@"Number of years: %d",years);
NSLog(@"Number of Months: %d,",months);
return years;
// End of Method
}