//获取当地时间
- (NSString *)getCurrentTime {
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
//yyyy-MM-dd-hh-mm-ss
[formatter setDateFormat:@"yyyy-MM-dd"];
NSString *dateTime = [formatter stringFromDate:[NSDate date]];
return dateTime;
}
//获取当地时间
- (NSString *)getCurrentTime {
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
//yyyy-MM-dd-hh-mm-ss
[formatter setDateFormat:@"yyyy-MM-dd"];
NSString *dateTime = [formatter stringFromDate:[NSDate date]];
return dateTime;
}