views:

54

answers:

2

I am trying to do this in Xcode...

Today's Date = Day of the year

October 13th = 303 (I think) January 1st = 1 December 31st = 365

NSDate to get todays date, then I'm out of idea =(

+1  A: 

See the documentation for NSCalendar and NSDateComponents

Nimrod
A: 
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:@"D"];
NSDate *date = [NSDate date];

NSLog(@"Today: %@", date);
NSLog(@"Date Formatted: %@", [dateFormatter stringFromDate:date]);

[dateFormatter release];
slowman21