//현재일자 세팅 

NSCalendar *calendar = [NSCalendar currentCalendar];

unsigned int unitFlags = NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit | NSHourCalendarUnit | NSMinuteCalendarUnit | NSSecondCalendarUnit;

NSDateComponents *comp = [calendar components:unitFlags fromDate:date]; 

 

//사용하기

[comp year]    //년도

[comp month] //월

[comp day]    //일

[comp hour]   //시

[comp minute]//분

[comp second]//초 

 



출처 : http://blog.naver.com/PostView.nhn?blogId=goldrushing&logNo=130086308063
Posted by 오늘마감