目前学习到的将NSDate对象输出时区本地化的放大之一.
关键点在于NSLocale对象.
#import<Foundation/Foundation.h>
int main(int argc,char *argv[]){
@autoreleasepool{
NSDate* date1=[NSDate date];
NSLog(@"the date is : %@",date1); //直接输出date1有时差
NSLocale* cn=[NSLocale currentLocale]; //本地化
NSLog(@"%@",[date1 descriptionWithLocale:cn]);
}
return 0;
}