Created
September 24, 2013 14:13
-
-
Save mikeabdullah/6685381 to your computer and use it in GitHub Desktop.
Build date for Cocoa apps
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
NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; | |
[formatter setLocale:[[[NSLocale alloc] initWithLocaleIdentifier:@"en_US_POSIX"] autorelease]]; | |
[formatter setDateFormat:@"MMM d yyyy"]; | |
[formatter setTimeZone:[NSTimeZone timeZoneForSecondsFromGMT:0]]; | |
NSString *string = @__DATE__; | |
NSDate *buildDate = [formatter dateFromString:string]; | |
[formatter release]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment