Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想以下一种格式显示数据:14:23 Sep 10,2012。我该怎么做?
14:23 Sep 10,2012
使用 NSDateFormatter
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; [dateFormatter setDateFormat:@"hh:mm MMM dd,yyyy"]; NSString *stringFromDate = [dateFormatter stringFromDate:[NSDate date]]; NSLog(@"today : %@", stringFromDate);