I am trying to create a formatter that will convert the date format shown to an NSDate object:
NSString *dateStr = @\"2010-06-21T19:00:00-05:00\";
NSDateForm
This is the default time format I got from a Sinatra ActiveRecord backend. Here is my solution.
-(NSDate *) dateFromString:(NSString *)string{
NSMutableString * correctedDateString = [[NSMutableString alloc] initWithString:string];
[correctedDateString deleteCharactersInRange: NSMakeRange(22, 1)];
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
[formatter setDateFormat:@"yyyy-MM-dd'T'HH:mm:ssZZZ"];
return [formatter dateFromString:correctedDateString];
}