Created
July 12, 2012 10:08
-
-
Save fousa/3097170 to your computer and use it in GitHub Desktop.
GCD Date Formatter
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
static NSDateFormatter *dateFormatter = nil; | |
static dispatch_once_t onceToken; | |
dispatch_once(&onceToken, ^{ | |
dateFormatter = [NSDateFormatter new]; | |
[dateFormatter setDateFormat:@"yyyy-MM-dd"]; | |
}); | |
return [dateFormatter dateFromString:self]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment