iOS新浪微博时间格式化

//解析新浪微博中的日期
-(NSString*)resolveSinaWeiboDate:(NSString*)date
{
    NSDateFormatter *iosDateFormater=[[[NSDateFormatter alloc]init]autorelease];
    iosDateFormater.dateFormat=@"EEE MMM d HH:mm:ss Z yyyy";
    //必须设置,否则无法解析
    iosDateFormater.locale=[[[NSLocale alloc]initWithLocaleIdentifier:@"en_US"]autorelease];
    NSDate *newDate=[iosDateFormater dateFromString:date];
    
    //目的格式
    NSDateFormatter *resultFormatter=[[[NSDateFormatter alloc]init]autorelease];
    [resultFormatter setDateFormat:@"MM月dd日 HH:mm"];
    
    NSString *dateString=[resultFormatter stringFromDate:newDate];
    return dateString;
}
原文地址:https://www.cnblogs.com/greywolf/p/2944974.html