iOS开发 Date转字符串

+ (NSString *)formatterDate:(NSNumber *)desDate

          WithDateFormatter:(NSString *)formatter{

  NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];

  [dateFormatter setDateFormat:formatter];

  

   NSDate *date = [NSDate dateWithTimeIntervalSince1970:[desDate doubleValue]];

  

  return [NSString stringWithFormat:@"%@",[dateFormatter stringFromDate:date]];

}

 

posted @ 2016-12-23 11:09  D-Ben  阅读(739)  评论(0编辑  收藏  举报