NSDateFormatter *dateFormtter=[[NSDateFormatter alloc] init];
[dateFormtter setDateFormat:@"yyyy-MM-dd"];
NSString *dateString=[dateFormtter stringFromDate:[dateFormtter dateFromString:@"2015-5-27"]];
NSLog(@"%@",dateString);
如果要不显示第一个0,可以写成@"yyyy-M-d"
@import url(http://i.cnblogs.com/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/css/cuteeditor.css);