//
//  DataTimeTool.m
//  Open
//
//  Created by 雷俊博 on 2019/10/10.
//  Copyright © 2019 黄江涛 . All rights reserved.
//

#import "DataTimeTool.h"

@implementation DataTimeTool

+ (NSDate *)dateFromString:(NSString *)dateStr DateFormat:(NSString *)dateFormatStr
{
    
    NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];//实例化一个NSDateFormatter对象
    
    [dateFormatter setDateFormat:dateFormatStr];//设定时间格式,这里可以设置成自己需要的格式
    
    NSDate*currentDate = [dateFormatter dateFromString:dateStr];
    
    return currentDate;
    
}



@end
