I seem to be running into great difficulty in attempting to convert a Google Calendar date string (parsed from a public JSON), into NSDate format.
The result from Google's Calendar API is in the format:
"2012-06-20T11:00:00.000+01:00"
I'm trying to format this as an NSDate, as follows:
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
formatter.dateFormat = @"yyyy-MM-dd'T'HH:mm:ss.SSSzzz";
NSDate *gmtDate = [formatter dateFromString:[whenDict objectForKey:@"startTime"]];
However, I keep getting a null result, so I was wondering if anyone knows what the correct [NSDate dateformat] would be for the result that I'm trying to convert...
I've tried all sorts of dateFormat variations but I haven't managed to find the right one, after a couple of hours of messing around with multiple letter variations!
i.e. I believe the issue is in the line:
formatter.dateFormat = @"yyyy-MM-dd'T'HH:mm:ss.SSSzzz";
Cheers,