摘要: 今天有个新手在群里问这问题,我也是新手,记得以前看过时间类就写的这2种方法给他。方法一:NSDate *date = [NSDate date];NSCalendar *cal = [NSCalendar currentCalendar];NSDateComponents *components = [cal components:NSHourCalendarUnit fromDate:date];NSString *strHour = [NSString stringWithFormat:@"hour is %d", [components hour]];方法二:NSDa 阅读全文
posted @ 2012-07-24 12:44 天已界 阅读(8558) 评论(0) 推荐(0) 编辑