I’m working through the book, doing the challenges as well. This one has me a little stumped.
printf("\n======= Challenge 13 ========\n"); BOOL isDST = [[NSTimeZone systemTimeZone] isDaylightSavingTime]; NSLog(@"Is it currently daylight savings time? %c", isDST); NSLog(@"What time zone is it? %@",[NSTimeZone systemTimeZone]);
The output I get is below, I can’t seem to figure out a way to print the BOOL result directly. If I try %d in as the token it’s a 0, which I think is right since I’m working it the day after the change, but I’d like it to say “NO”. I followed the definition of BOOL to
Also, isDaylightSavingTime shows a return type here:
======= Challenge 13 ========
2011-11-06 15:08:34.985 TimeAfterTime[29998:707] Is it currently daylight savings time?
2011-11-06 15:08:34.986 TimeAfterTime[29998:707] What time zone is it? America/New_York (EST) offset -18000
Program ended with exit code: 0