Number of days in a month


/ Published in: Objective C
Save to your folder(s)



Copy this code and paste it in your HTML
  1. // number of day in month
  2. NSCalendar* cal = [NSCalendar currentCalendar];
  3. NSDateComponents* comps = [[[NSDateComponents alloc] init] autorelease];
  4. [comps setMonth:[[monthFormat stringFromDate:[NSDate date]] intValue]];
  5. NSRange range = [cal rangeOfUnit:NSDayCalendarUnit
  6. inUnit:NSMonthCalendarUnit
  7. forDate:[cal dateFromComponents:comps]];

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.