获取当前date和时间

我系统的date时间是5月26日22:55但是当我与[NSDate date]date时间是5月27日02:35

是因为时区吗?

如果是的话,如何解决这个问题,当我得到date的时间,给我我的系统的date,不检查时区

 NSLocale* currentLocale = [NSLocale currentLocale]; [[NSDate date] descriptionWithLocale:currentLocale]; 

或使用

 NSDateFormatter *dateFormatter=[[NSDateFormatter alloc] init]; [dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"]; // or @"yyyy-MM-dd hh:mm:ss a" if you prefer the time with AM/PM NSLog(@"%@",[dateFormatter stringFromDate:[NSDate date]]);