NSTimeZone
//管理时区的类。
NSTimeZone *zone = [NSTimeZonesystemTimeZone];NSLog(@"%@",zone);
NSDate *date = [NSDatedate];NSLog(@"%@",date);
//返回当前时区与格林威治时间之间的时间差(使用秒数表示)。
NSInteger intint = [zonesecondsFromGMT];NSLog(@"%li",(long)intint);
//返回所有的时区名,可以用这些时区明生成时区。
NSArray *arry = [NSTimeZoneknownTimeZoneNames];NSLog(@"%@",arry);
//使用时区名来生成一个NSTimeZone对象
NSTimeZone *zone2 = [NSTimeZonetimeZoneWithName:@"Europe/Athens"];
NSInteger int2 = [zone2secondsFromGMT];NSLog(@"%ld",(long)int2);//@"Pacific/Ponape",39600
NSTimeZone *defaultTimeZone = [NSTimeZonedefaultTimeZone];
NSLog(@"%@",defaultTimeZone);//Asia/Harbin (GMT+8) offset 28800
NSTimeZone *localTimeZone = [NSTimeZonelocalTimeZone];
NSLog(@"%@",localTimeZone);//Local Time Zone (Asia/Harbin (GMT+8) offset 28800)
NSInteger secondsFromGMT = [localTimeZonesecondsFromGMT];
//根据时区和NSDate获取当前本地时间
NSDate *localDate = [NSDatedate];
localDate = [localDate dateByAddingTimeInterval:secondsFromGMT];
NSLog(@"%@",localDate);