开发者

Get current time [duplicate]

开发者 https://www.devze.com 2023-01-18 19:04 出处:网络
This开发者_如何学Go question already has answers here: Closed 10 years ago. Possible Duplicate: Retrieving current local time on iPhone?
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

精彩评论

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

关注公众号