Skip to content

Instantly share code, notes, and snippets.

@slmcmahon
Created December 5, 2011 01:25
Show Gist options
  • Save slmcmahon/1431911 to your computer and use it in GitHub Desktop.
Save slmcmahon/1431911 to your computer and use it in GitHub Desktop.
Convert XML formatted date to an NSDate
- (NSDate *)convertXmlDate:(NSString *)xmlDate {
NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init];
[dateFormat setDateFormat:@"yyyy-MM-dd'T'HH:mm:ss.SSS"];
NSDate *date = [dateFormat dateFromString:xmlDate];
[dateFormat release];
return date;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment