Last active
August 27, 2015 18:21
-
-
Save carljparker/ed6fd95fc6dbcdad7479 to your computer and use it in GitHub Desktop.
NSDateFormatter Singleton
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
static NSDateFormatter *formatter = nil; | |
static dispatch_once_t onceToken; | |
dispatch_once( &onceToken, ^{ | |
formatter = [[NSDateFormatter alloc] init]; | |
formatter.dateFormat = @"yyyy-MM-dd HH:mm:ss"; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment