I am trying to format a date from an RSS feed:
Mon, 02/27/2012 10:33:00 PM EDT (format from the RSS feed)
To:
Mon, 27 Feb 2012 10:33
Here is what I do in the code:
NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init]; [dateFormat setDateFormat:@"EE, d MM yyyy HH:mm:ss zzz"]; NSDate *date = [dateFormat dateFromString:@"Mon, 27 Feb 2012 10:33:00 EDT"]; [dateFormat setDateFormat:@"EE, d MMM yyyy hh:mm a"]; formatedDateLabel.text = [dateFormat stringFromDate:date]; [dateFormat release];
However, this always outputs:
Mon, Feb 27, 2012 9:33 AM
Please note that my devices are set to EST. I tried setting the date format to fit EDT, but that does not seem to make any difference.
Any ideas on what I'm doing wrong?
source share