Below is my code
NSString *dateandtime =[NSString stringWithFormat:@"%@",self.eventtime]; NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; [dateFormatter setDateFormat:@"EEE, dd MMM yyyy HH:mm:ss Z"]; NSDate *dateFromString = [[NSDate alloc] init]; dateFromString = [dateFormatter dateFromString:dateandtime];
If I print my name self.event, I get the output as Mon, 7 Jan 2013 15:30:00 CST , but when I pass this line to NSDateFormatter , I get null , I donβt know why I tried many combinations of date formats , but I can't decide if anyone can help me
source share