In my app, want to get the day (i.e. Sunday
, Monday
,etc.) from the date.
My code is as follow:
NSDate *currentDate = [NSDat
you face problem because it take local time zone
try this
NSDateFormatter *dateformate = [[NSDateFormatter alloc] init] ;
[dateformate setTimeZone:[NSTimeZone timeZoneWithName:@"Australia/Sydney"]];
[dateformate setDateFormat:@"EEEE"];
NSLog(@"%@", [dateformate stringFromDate:[NSDate date]]);
NSLog(@"%@", [NSTimeZone knownTimeZoneNames]);
set time zone that you required.it may work and help you.
similar problem in NSCalendar first day of week link refer it.also may help you.