PST and AKST Time Zone Error
When I run this code below the PST and AKST timezones are never run... Both of these are run perfectly:
NSTimeZone *pacificTimeZone = [NSTimeZone timeZoneWithAbbreviation:@"PST"];
NSTimeZone *alaskaTimeZone = [NSTimeZone timeZoneWithAbbreviation:@"AKST"];
But neither one of these are run:
}else if ([local isEqual: pacificTimeZone]) {
NSLog(@"Pacific");
} else if ([local isEqual: alaskaTimeZone]) {
NSLog(@"Alaska");
Any suggestions?
NSTimeZone *local = [NSTimeZone localTimeZone];
NSTimeZone *centralTimeZone = [NSTimeZone timeZoneWithAbbreviation:@"CST"];
NSTimeZone *easternTimeZone = [NSTimeZone timeZoneWithAbbreviation:@"EST"];
NSTimeZone *mountainTimeZone = [NSTimeZone timeZoneWithAbbreviation:@"MST"];
NSTimeZone *pacificTimeZone = [NSTimeZone timeZoneWithAbbreviation:@"PST"];
NSTimeZone *alaskaTimeZone = [NSTimeZone timeZoneWithAbbreviation:@"AKST"];
NSTimeZone *honoluluTimeZone = [NSTimeZone timeZoneWithAbbreviation:@"HST"];
NSLog(@"LOCAL TIME ZONE: %@", local);
NSLog(@"CST TIME %@", centralTimeZone);
NSLog(@"EST TIME %@", easternTimeZone);
NSLog(@"MST TIME %@", mountainTimeZone);
NSLog(@"PST TIME %@", pacificTimeZone);
NSLog(@"AKST TIME %@", alaskaTimeZone);
NSLog(@"HST TIME %@", honoluluTimeZone);
if ([local isEqual: centralTimeZone])
{
NSLog(@"Central");
} else if ([local isEqual: easternTimeZone]) {
NSLog(@"Eastern");
} else if ([local isEqual: mountainTimeZone]) {
NSLog(@"Mountain");
}else if ([local isEqual: pacificTimeZone]) {
NSLog(@"Pacific");
} else if ([local isEqual: alaskaTimeZone]) {
NSLog(@"Alaska");
} else if ([local isEqual: honoluluTimeZone]) {
NSLog(@"Honolulu");
}
Thanks!