I am an iOS newbie. I am looking to parse a date such as “2012-01-02T00:00:00-05:00” into a “YYYY-MM-dd HH:mm:ss” format. So far I have done the following –
NSDateFormatter *inputFormatter = [[NSDateFormatter alloc] init];
[inputFormatter setTimeZone:[NSTimeZone timeZoneWithAbbreviation:@"UTC"]];
[inputFormatter setDateFormat:@"YYYY-MM-dd HH:mm:ss"];
NSString *xExpDate = expirationDate;
NSString *tempExpDate = [xExpDate stringByReplacingOccurrencesOfString:@"T" withString:@" "];
I don’t quite get what to do after this. Any ideas?
I think your datestring isnt correct, because the zone should havent any “:”