I need to convert 2013/5/23 to day. here the problem is month is having as 5.
2013/5/23 => Thursday
code that I am using:
NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init];
[dateFormat setDateFormat:@"yyyy/MM/dd"];
NSDate *date = [dateFormat dateFromString:@"2013/5/23"];
NSLog(@"Date :%@",date);
[dateFormat setDateFormat:@"EEEE"];
NSLog(@"DAY %@",[dateFormat stringFromDate:date]);
and the output is
Date :2013-05-22 18:30:00 +0000
DAY Thursday
Actually day is printed correctly according to my input date. But printed date is wrong.
it should be 2013-05-23