This code keeps returning NULL and I can't for the life of me understand why
Code:
NSString *pubDate = @"Tue, 30 Sep 2008 19:45:23 -0400";
//remove the time, returns: Tue, 30 Sep 2008
NSString *subStringPubDate = [pubDate substringWithRange:NSMakeRange(0, 16)];
//create formatter and format
NSDateFormatter *dtsFormatter = [[[NSDateFormatter alloc] init] autorelease];
[dtsFormatter setDateFormat:@"EEE, d MMM yyyy"];
//run the string through the formatter
NSDate *formattedDate = [dtsFormatter dateFromString:subStringPubDate];
NSLog(@"%@", formattedDate);