I am having an issue with this message. It doesn’t seem to be able to convert to NSDate with my dateString
//dateString = @"2012-03-24 00:00:00 +0000"
+ (NSDate *)dateFromString:(NSString *)dateString {
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:@"yyyy-MM-dd'T'HH:mm:ss'Z'"];
[dateFormatter setTimeZone:[NSTimeZone timeZoneForSecondsFromGMT:0]];
NSDate *result = [dateFormatter dateFromString:dateString]; //Invalid CFStringRef
[dateFormatter release];
return result;
}
If the time zone is specified with an offset
+0000inyou have to use:
Notice the double
'Z'and the removal of'T'.Check here for more information.