I have searched over internet for a long time to get this but I can't find the solution. I have received a date string from web services as "22 May 2014"
, I have to convert into NSDate
format for check it with current date. And I have to find out the date from web service is in future or in past time.
The actual problem is that when I convert this using
NSDate *date;
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:@"dd MMMM YYYY"];
date = [dateFormatter dateFromString:dateString];
But I get an entirely Different Date, Sample Input dateString:22 June 2014
and Output I get is 2013-12-21 18:30:00+0000
Please suggest any solutions.
Thanks in advance. :)