In my app, want to get the day (i.e. Sunday
, Monday
,etc.) from the date.
My code is as follow:
NSDate *currentDate = [NSDat
NSCalendar* calender = [NSCalendar currentCalendar];
NSDateComponents* component = [calender components:NSWeekdayCalendarUnit fromDate:[NSDate date]];
int weekDay = [component weekday];
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
NSString *weekdayString = [[formatter weekdaySymbols] objectAtIndex:weekDay - 1];
NSLog(@"Day ::: %@", weekdayString);