Initially I thought that using this code
+ (NSString *)getDayOfTheWeek:(NSDate *)date format:(NSString*)format
{
NSDateFormatter *dateFormatter = [[[NSDateFormatter alloc] init] autorelease];
dateFormatter.dateFormat = format;
NSString *formattedDateString = [dateFormatter stringFromDate:date];
NSLog(@"Des pico je: %@",formattedDateString);
return formattedDateString;
}
NSDate *now = [NSDate date];
NSString *today = [self getDayOfTheWeek:now format:@"c"]
should return a string with a number for each day, but it gets different results for different regional format settings. (Mon = 1 or Sun = 1) and maybe some variations. don't know. So is there a common way to get this solution generically for all region date type settings on iPhone easily?