Created
March 3, 2012 19:00
-
-
Save dbreunig/1967518 to your computer and use it in GitHub Desktop.
NSString Category Method: NSDate from Twitter Date String
This file contains hidden or 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
@interface NSString (Twitter) | |
- (NSDate*)twitterDate; | |
@end | |
@implementation NSString (Twitter) | |
- (NSDate*)twitterDate | |
{ | |
NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; | |
[formatter setDateFormat:@"eee MMM dd HH:mm:ss ZZZZ yyyy"]; | |
return [formatter dateFromString:self]; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment