ios获取系统当前日期,一定日期格式的代码

 

ios获取系统当前日期,一定日期格式的代码

 

NSDate *  senddate=[NSDate date];  

NSDateFormatter  *dateformatter=[[NSDateFormatter alloc] init];  

[dateformatter setDateFormat:@"YYYYMMdd"];  

NSString *  locationString=[dateformatter stringFromDate:senddate];    

NSLog(@"locationString:%@",locationString);

 [dateformatter release];

 

 

 

你可能感兴趣的:(ios获取系统当前日期,一定日期格式的代码)