iOS NSString转NSDate
2017-09-19 本文已影响0人
H_A_N
+(NSDate*)dateWithString:(NSString*)dateString andFomatter:(NSString*)fomatter
{
NSDateFormatter * dateF = [[NSDateFormatter alloc] init];
dateF.dateFormat = fomatter;
NSDate *date = [dateF dateFromString:dateString];
return date;
}