Q:

Day of the week in Objective C

Possible Duplicate:
How do I get the day of the week in Objective-C? 

How do I print the day of the week? What object should I use? I need the day (e.g. Sunday, Thursday), not the date in the month.
Update:
Specifically: how can I find the number of the day of the week (e.g. 1, 5)

A:

Make an instance of NSDate (for right now, use [NSDate date]), and then use an NSDateFormatter and a format string as described here.
NSDate *today = [NSDate date];
NSDateFormatter *myFormatter = [[NSDateFormatter alloc] init];
[myFormatter setDateFormat:@"EEEE"]; // day, like "Saturday"
[myFormatter setDateFormat:@"c"]; // day number, like 7 for saturday

NSString *dayOfWeek = [myFormatter stringFromDate:today];
NSLog(@"Today is: %@", dayOfWeek);

