For the life of me i cannot seem to convert this nsstring into an nsdate with the dateformatter, its coming from an xml feed with this format:2016-06-03T19:00:00+00:00
I'm using this code but the date is returning null.
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
dateFormatter.locale = [[NSLocale alloc]initWithLocaleIdentifier:@"en_US_POSIX"];
dateFormatter.dateFormat = @"yyyy-MM-dd'T'HH:mm:ss'ZZZZ'";
NSTimeZone *timeZoney = [NSTimeZone timeZoneWithName:@"UTC"];
dateFormatter.timeZone = timeZoney;
NSLog(@"passed: %@",theDate);
NSDate *convertedDate = [dateFormatter dateFromString:theDate];
NSLog(@"Date is %@",convertedDate);
I've been using this website http://unicode.org/reports/tr35/tr35-6.html#Date_Format_Patterns to try and figure it out but i can't seem to get it working. Any help would be appreciated.