Sample Code:
#import <Foundation/Foundation.h>
#import "Enum.h"
int main(int argc,const char * argv[])
{
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
NSDate * senddate = [NSDate date];
NSCalendar * cal = [NSCalendar currentCalendar];
NSUInteger unitFlags = NSDayCalendarUnit | NSMonthCalendarUnit | NSYearCalendarUnit;
NSDateComponents * component = [cal components:unitFlags fromDate:senddate];
NSInteger year = [component year];
NSInteger month = [component month];
NSInteger day = [component day];
NSLog(@"%4d/%2d/%2d",year,month,day);
[pool drain];
return 0;
}