Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how do I get the day of the week using NSDate and show using NSLog in iOS? [duplicate]

Tags:

objective-c

Possible Duplicate:
Objective C - How can i get the weekday from NSDate?

How do I get the day of the week using NSDate and show using NSLog?

I wonder the current day, such as today.

Ex: NSLog(@"the day is:",day)
Resp: "the day is: Monday"

like image 756
imalve Avatar asked Mar 26 '12 14:03

imalve


1 Answers

NSDateFormatter* day = [[NSDateFormatter alloc] init];
[day setDateFormat: @"EEEE"];
NSLog(@"the day is: %@", [day stringFromDate:[NSDate date]]);
like image 83
tronbabylove Avatar answered Sep 23 '22 13:09

tronbabylove