I would like to get the day number from a date. I have the following code which is producing undesirable output:
NSDateFormatter* numDay = [[MSDateFormatter alloc]init];
numDay.dateFormat = @"DD";
dateString = [numDay stringFromDate:the_dte];
DayNum.text = [NSString stringWithFormat:@"%@", dateString];
For instance, if the_dte is 2014-01-07 I get a dayNum of 38
I would like dayNum to hold 7 instead. I assume it has to do with my format. I just do not know a format to put it in to get what I want.