@interface NSTimeZone (NSExtendedTimeZone)
+ (NSTimeZone *)systemTimeZone; 系统时区
+ (void)resetSystemTimeZone;
+ (NSTimeZone *)defaultTimeZone; 默认时区
+ (void)setDefaultTimeZone:(NSTimeZone *)aTimeZone;
+ (NSTimeZone *)localTimeZone; 本地时区
+ (NSArray *)knownTimeZoneNames;
NSArray *arr = NSTimeZone.knownTimeZoneNames;
for (NSUInteger a = 0; a < arr.count; a++) {
NSLog(@"%@",[arr objectAtIndex:a]);
}
+ (NSDictionary *)abbreviationDictionary;
+ (void)setAbbreviationDictionary:(NSDictionary *)dict NS_AVAILABLE(10_6, 4_0);
NSDictionary *dic = NSTimeZone.abbreviationDictionary;
NSLog(@"%@",dic);
+ (NSString *)timeZoneDataVersion NS_AVAILABLE(10_6, 4_0);
NSString *string = NSTimeZone.timeZoneDataVersion;
@property (readonly) NSInteger secondsFromGMT; 时差
@property (readonly, copy) NSString *abbreviation; 简称
@property (readonly, getter=isDaylightSavingTime) BOOL daylightSavingTime; 夏时令
@property (readonly) NSTimeInterval daylightSavingTimeOffset NS_AVAILABLE(10_5, 2_0); //
@property (readonly, copy) NSDate *nextDaylightSavingTimeTransition NS_AVAILABLE(10_5, 2_0); //
@property (readonly, copy) NSString *description;
是否一致
- (BOOL)isEqualToTimeZone:(NSTimeZone *)aTimeZone;
typedef NS_ENUM(NSInteger, NSTimeZoneNameStyle) {
NSTimeZoneNameStyleStandard, // Central Standard Time
NSTimeZoneNameStyleShortStandard, // CST
NSTimeZoneNameStyleDaylightSaving, // Central Daylight Time
NSTimeZoneNameStyleShortDaylightSaving, // CDT
NSTimeZoneNameStyleGeneric, // Central Time
NSTimeZoneNameStyleShortGeneric // CT
};
- (NSString *)localizedName:(NSTimeZoneNameStyle)style locale:(NSLocale *)locale NS_AVAILABLE(10_5, 2_0);
@end