Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Build date for Cocoa apps
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
You can’t perform that action at this time.