8
thể trùng lặp:
Retrieving current local time on iPhone?Nhận thời điểm hiện tại
Làm thế nào để có được thời gian hiện tại? (Giờ: phút: giây)
thể trùng lặp:
Retrieving current local time on iPhone?Nhận thời điểm hiện tại
Làm thế nào để có được thời gian hiện tại? (Giờ: phút: giây)
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];