传入2018-08-13T17:40:51.733+0000格式,返回正常格式
+ (NSDate *)timeStringToDate:(NSDate *)fromDate {
NSString * formatterString = @"yyyy-MM-dd HH:mm:ss";
// DateFormatter, Calendar初始化比较消耗内存, 定义成单例
[MHDateFormatter sharedFormatter].dateFormat = formatterString;
// 指定区域,真机一定要指定
[MHDateFormatter sharedFormatter].locale = [NSLocale localeWithLocaleIdentifier: @"en"];
//转换成常用格式字符串
NSString *dateString = [[MHDateFormatter sharedFormatter] stringFromDate:fromDate];
再将常用格式的字符串转成date
return [[MHDateFormatter sharedFormatter] dateFromString: dateString];
}