摘要: 在开发iOS程序时,有时候需要将时间格式调整成自己希望的格式,这个时候我们可以用NSDateFormatter类来处理。例如://实例化一个NSDateFormatter对象NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];//设定时间格式,这里可以设置成自己需要的格式[dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];//用[NSDate date]可以获取系统当前时间NSString *currentDateStr = [dateForma 阅读全文
posted @ 2014-03-14 10:07 Kristen 阅读(76168) 评论(0) 推荐(4) 编辑
摘要: //获取日历事件 EKEventStore* eventStore = [[EKEventStorealloc] init]; NSDate* ssdate = [NSDatedateWithTimeIntervalSinceNow:-3600*24*90];//事件段,开始时间 NSDate* ssend = [NSDatedateWithTimeIntervalSinceNow:3600*24*90];//结束时间,取中间 NSPredicate* predicate = [eventStore predicateForEventsWithStartDate:ssdate ... 阅读全文
posted @ 2014-03-14 10:03 Kristen 阅读(3625) 评论(0) 推荐(0) 编辑