I am creating a NSDateCategory that formats a date but it always returns null, any ideas?
2011-06-05T16:55:00Z
+ (NSDate *)dateFromString:(NSString *)dateString
{
NSLog(@"date string %@", dateString);
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:@"yyyy-MM-dd+hh:MM:ss"];
NSDate *result = [dateFormatter dateFromString:dateString];
[dateFormatter release];
return result;
}
What a huge mission! Finally figured it out. The timezone needs to be set before you even worry about the formatting!