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

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

 

NSDate *  senddate=[NSDate date];  

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

[dateformatter setDateFormat:@"YYYYMMdd"];  

NSString *  locationString=[dateformatter stringFromDate:senddate];    

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

 [dateformatter release];

 

猜你喜欢

转载自stephen830.iteye.com/blog/2245763