Created
December 5, 2011 01:25
-
-
Save slmcmahon/1431911 to your computer and use it in GitHub Desktop.
Convert XML formatted date to an NSDate
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (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