I am able to display the build date for my app in the simulator, but whenever I archive the app, and upload it to TestFlight, and then install it on a device, the build date doe
To get build date with format 'yyMMddHHmm' you could try this:
+ (NSString *)GetBuildDate {
NSString *buildDate;
// Get build date and time, format to 'yyMMddHHmm'
NSString *dateStr = [NSString stringWithFormat:@"%@ %@", [NSString stringWithUTF8String:__DATE__], [NSString stringWithUTF8String:__TIME__]];
// Convert to date
NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init];
[dateFormat setDateFormat:@"LLL d yyyy HH:mm:ss"];
NSDate *date = [dateFormat dateFromString:dateStr];
// Set output format and convert to string
[dateFormat setDateFormat:@"yyMMddHHmm"];
buildDate = [dateFormat stringFromDate:date];
[dateFormat release];
return buildDate;
}