Created
October 1, 2014 14:00
-
-
Save AlexHedley/1f916f41ef31e334f5b7 to your computer and use it in GitHub Desktop.
Parse Date
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
//Parsing a date in the following format '//2014-07-13T20:35:47.000Z' | |
//Use the DateFormat of @"yyyy-MM-dd'T'HH:mm:ss.zzz'Z'" | |
- (NSString *)formattedDate { | |
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; | |
[dateFormatter setDateFormat:@"yyyy-MM-dd'T'HH:mm:ss.zzz'Z'"]; //2014-07-13T20:35:47.000Z | |
NSDate *tempDate = [dateFormatter dateFromString:self.date]; | |
[dateFormatter setDateFormat:@"EE MMM, dd"]; | |
return [dateFormatter stringFromDate:tempDate]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment