I have a String which looks like this
NSString *string = @"2012-04-30T23:59:00+10:00";
Right now, I am trying to convert that into NSDate format (So I can store the data in a database at a later stage). Right now, I can’t seem to get a date format that works with my current date. I am using
NSDateFormatter *assignmentDateFormat = [[NSDateFormatter alloc] init];
[assignmentDateFormat setDateFormat:@""];
to parse my date but I just cant seem to get the combination right (e.g. YYYY-MM-dd etc.).
Any help would be greatly appreciated and if someone knows how to do the timezone part (+10:00) that would be amazing. Thanks!
The full specification is here: http://unicode.org/reports/tr35/tr35-10.html#Date_Format_Patterns
(Kinda tricky to find in Apple documentation… bookmark it!)
Edit: OK, try this one:
yyyy-MM-dd'T'HH:mm:ssZ