Is it possible to generate an embedded Unix timestamp via a preprocessor macro?
For instance: #define VERSION_EXPIRE __TIMESTAMP__
The reason for th
I've solved it as follows:
#define VERSION_TIMESTAMP __DATE__" "__TIME__"\x0"
In some other class
+ (NSDate *)versionExpiresInDays:(NSUInteger)days {
NSString *dateString = [NSString stringWithUTF8String:VERSION_TIMESTAMP];
NSLocale *enLocale = [[[NSLocale alloc] initWithLocaleIdentifier:@"en_US"] autorelease];
NSDate *compiledOn = [NSDate dateWithNaturalLanguageString:dateString locale:enLocale];
return [compiledOn dateByAddingTimeInterval:days*24*60*60];
}