iphone-common-codes-ccteam源代码 CCNSTimeZone.m
//
// CCNSTimeZone.m
// CCFC
//
// Created by xichen on 11-12-24.
// Copyright 2011 ccteam. All rights reserved.
//
#import "CCNSTimeZone.h"
#import "CCLog.h"
@implementation NSTimeZone(cc)
+ (void)setTimeZone:(NSString *)zoneStr
{
NSTimeZone *timeZone = [NSTimeZone timeZoneWithName:zoneStr];
[NSTimeZone setDefaultTimeZone:timeZone];
}
+ (void)logKnownTimeZones
{
NSArray *array = [NSTimeZone knownTimeZoneNames];
LOG_ARR(array);
for(int i = 0;i < [array count];++i)
{
NSTimeZone *timeZone = [NSTimeZone timeZoneWithName:[array objectAtIndex:i]];
LOG_ID(timeZone);
}
}
@end
可能有更新:
googlecode链接地址:http://code.google.com/p/iphone-common-codes-ccteam/source/browse/trunk/CCFC/files/CCNSTimeZone.m
github地址: https://github.com/cxsjabc/iphone-common-codes-ccteam/tree/master/CCFC/files/CCNSTimeZone.m