I would like to show the name of day in my iPhone application and i don\'t found the solution. Thanks for help
NSDate category
+ (NSString *)dayNameWith0Monday:(NSInteger)index {
static NSDateFormatter * DateFormatter = nil;
if (DateFormatter == nil) {
DateFormatter = [[NSDateFormatter alloc] init];
[DateFormatter setDateFormat:@"EEEE"];
[DateFormatter setTimeZone:[NSTimeZone timeZoneForSecondsFromGMT:0]];
}
NSDate * day = [NSDate dateWithTimeIntervalSince1970:((4 * 24 * 60 * 60) + (24 * 60 * 60 * index))];
return [DateFormatter stringFromDate:day];
}
0 will always be Monday! in case you need such behaviour