导航

如何获得毫秒级时间(iphone)

Posted on 2010-12-28 13:39  山姆蜀黍  阅读(861)  评论(0编辑  收藏  举报

NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateStyle:NSDateFormatterMediumStyle];
[dateFormatter setTimeStyle:NSDateFormatterShortStyle];
//[dateFormatter setDateFormat:@"hh:mm:ss"]
[dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss.SSS"];
NSLog(@"Date%@", [dateFormatter stringFromDate:[NSDate date]]);
[dateFormatter release];