NSDate *today=[NSDate date];
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:@"EEEE"];
NSString *currentDay = [dateFormatter stringFromDate:today];
NSLog(@"currentDay=%@", currentDay);
//currentDay is 1 for Sun, 2 for Mon
[dateFormatter release];
No comments:
Post a Comment