Date Formatter


#1

I’m trying to create a date from the PubDate and am having no luck with the NSDateFormatter. I trimmed the pubDate so it looks like this

19 Aug 2013 03:30:00

I then tried applying a formatter with

NSDateFormatter *strToDateFormatter = [[NSDateFormatter alloc] init];
[strToDateFormatter setDateFormat:@"dd MMM yyyy HH:mm:ss"];
NSDate *theDate = [strToDateFormatter dateFromString:newerDateStr];

But when I look at theDate using a breakpoint I am seeing a nil for theDate. Any suggestions?


#2

I got it figured out. Needed to set the monthSymbols to the strings reported by PubDate.

But now, my dates are in Spanish, I think? How’d that happen?


#3

Fixed it. Somehow the region got changed to Mexico. Don’t know how that happened.