One simple thing on conversion from NSString to NSDate. How can I convert Mon, 27 August 2012 01:30 AM to NSDate in this same format. I tried with NSDateFormatter. But I am not getting it in this required format. Can anyone help? This is what I tried.
NSDateFormatter *df=[[NSDateFormatter alloc] init];
[df setDateFormat:@"EEEE,dd MM yyyy HH:mm a"];
NSDate *date1 = [df dateFromString:@"Mon,27 August 2012 01:30 AM"];
NSLog(@"%@",date1);
NSDateFormatter is to specify the format that will appear in the date-string when extracting string from date or the format that is in the date-string when extracting date from string
So whenever you extract NSDate from a NSString, NSDate is always obtained in default date format(eg 2012-08-27 00:30:00 +0000)… only the when you extract NSString from NSDate, NSString can be obtained in desired(custom) format that you set in NSDateFormatter.