-(NSString *)stringtooDate:(NSString *)timeString{spa
// [self stringtooDate:[datestr substringToIndex:10]];orm
NSTimeInterval time=[timeString doubleValue];//由於時差問題要加8小時 == 28800 sec對象
NSDate *detaildate=[NSDate dateWithTimeIntervalSince1970:time];string
//實例化一個NSDateFormatter對象it
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];test
//設定時間格式,這裏能夠設置成本身須要的格式date
[dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];im
NSString *currentDateStr = [dateFormatter stringFromDate: detaildate];時間
return currentDateStr;time
}