hi, i am using following code to get months correctly....it returns correct data..but it gives 2 months when i get from two dates...suppose if i give two dates like janauary to march, it will give 2 months...how can i change to no of days exactly(included feb)...
NSCalendar *sysCalendar = [NSCalendar currentCalendar];
unsigned int unitFlags = NSSecondCalendarUnit | NSHourCalendarUnit | NSMinuteCalendarUnit | NSDayCalendarUnit | NSMonthCalendarUnit;
NSDateComponents *breakdownInfo = [sysCalendar components:unitFlags fromDate:date1 toDate:date2 options:0];
NSLog(@"Break down: %dmons", [breakdownInfo month]);