NSDateFormatter*dateFormat=[[NSDateFormatteralloc]init];[dateFormatsetDateFormat:formatString];NSLog(@"date------:%@",date);NSString*dateString=[dateFormatstringFromDate:date];NSLog(@"time:%@",dateString);date打印出来是正常的但是无法转换成对应的格式。打印出来是下面的结果2015-02-0514:22:22.057Puyun[2416:144800]date------:14213115000002015-02-0514:22:22.057Puyun[2416:144800]time:(null)很奇怪。我拷贝了一块代码到程序中NSDateFormatter*formatter=[[NSDateFormatteralloc]init];[formattersetDateStyle:NSDateFormatterMediumStyle];[formattersetTimeStyle:NSDateFormatterShortStyle];[formattersetDateFormat:@"yyyyMMddHHMMss"];NSDate*datea=[formatterdateFromString:@"1283376197"];NSLog(@"date1:%@",datea);居然打印出2015-02-0515:47:48.619Puyun[2952:183558]date1:(null)是不是漏了什么东西请帮忙啊
相关分类