开发者

Get current time [duplicate]

This开发者_如何学Go question already has answers here: Closed 10 years ago.

Possible Duplicate:

Retrieving current local time on iPhone?

How to get current time ?(hour:minute:second)


NSDate *now = [NSDate date];

NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
dateFormatter.dateFormat = @"hh:mm:ss";
[dateFormatter setTimeZone:[NSTimeZone systemTimeZone]];
NSLog(@"The Current Time is %@",[dateFormatter stringFromDate:now]);
[dateFormatter release];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜