+(NSString*)dateStringWithDate:(NSDate *)date andFomatter:(NSString *)fomatter
{
NSDateFormatter * dateF = [[NSDateFormatter alloc] init];
dateF.dateFormat = fomatter;
if([dateF stringFromDate:date].length > 0)
return [dateF stringFromDate:date];
dateF.dateFormat = @"yyyy-MM-dd";
return [dateF stringFromDate:date];
}
网友评论