/* Test time zone code. */ #include #include #include #include #include #include #include int main () { NSTimeZone *system; NSTimeZone *other; NSCalendarDate *date; CREATE_AUTORELEASE_POOL(pool); GSPrintf(stdout, @"GMT time zone %x\n", [NSTimeZone timeZoneWithAbbreviation:@"GMT"]); GSPrintf(stdout, @"System time zone\n"); system = [NSTimeZone systemTimeZone]; GSPrintf(stdout, @" %@\n\n", [system description]); GSPrintf(stdout, @"Local time zone:\n %@\n\n", [[NSTimeZone localTimeZone] description]); GSPrintf(stdout, @"Time zone for PST (from dict):\n %@\n", [[NSTimeZone abbreviationDictionary] objectForKey: @"PST"]); GSPrintf(stdout, @"Time zones for PST (from map):\n %@\n", [[[NSTimeZone abbreviationMap] objectForKey: @"PST"] description]); other = [NSTimeZone timeZoneWithAbbreviation: @"CEST"]; GSPrintf(stdout, @"Time zone for CEST:\n %@\n", other); date = [[NSCalendarDate alloc] initWithString:@"09/04/2003 17:58:45 CEST" calendarFormat:@"%m/%d/%Y %H:%M:%S %Z"]; GSPrintf(stdout, @"Date in CEST:\n %@\n", date); RELEASE(pool); return 0; }