时间戳转换为时间
+(NSString *)dateStyle:(NSString *)date{ NSString *invalidTime=[NSString stringWithFormat:@"%f",[date doubleValue]/1000];//时间戳 NSTimeInterval effectTime=[invalidTime doubleValue]+28800;//因为时差问题要加8小时 == 28800 NSDate *effectDate=[NSDate dateWithTimeIntervalSince1970:effectTime]; NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; [dateFormatter setDateFormat:@"yyyy-MM-dd"]; NSString *effectDateStr = [dateFormatter stringFromDate: effectDate]; return effectDateStr; }