#import <Foundation/Foundation.h>
int main(int argc, const char * argv[]) {
@autoreleasepool {
NSTimeZone *here = [NSTimeZone systemTimeZone];
double saving = [here isDaylightSavingTime];
if (saving < 1){
NSLog(@"It is not Daylight Saving Time");
} else {
NSLog(@"It is Daylight Saving Time");
}
NSLog(@"Value: %.0f",saving);
}
return 0;
}
First I determine my systems timezone. After that, I am creating a double variable in which I determine whether my timezone is currently in DayLightSavingTime. (I am using a variable because the answer can only be yes or no, which the computer will give out as a 1 for YES or a 0 for NO. NOTE: That’s what I assume. And it has worked for me.)
After that I give the information out via an NSLog and I’m done.