获取当前时间

NSDate *nowDate = [NSDate date];
    NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
    [dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
    NSString *curDate = [dateFormatter stringFromDate:nowDate];

 

转自:http://www.cnblogs.com/zhangdadi/archive/2012/07/24/2606305.html

时间格式:http://blog.csdn.net/ztp800201/article/details/9360431

 

你可能感兴趣的:(当前时间)