I have the following method in a NSDate
category; it's meant to just give me the instance of the date in 24-hour format:
-(NSString *)serverHourFormat
{
NSDateFormatter *dateFormat=[[NSDateFormatter alloc] init];
NSLog(@"hour before: %@",[self description]);
[dateFormat setDateFormat:@"HH:mm"];
NSLog(@"hour after: %@",[dateFormat stringFromDate:self]);
return [dateFormat stringFromDate:self];
}
The log of before and after:
hour before: 2014-05-20 08:25:00 p.m. +0000
hour after: 03:55 p.m.
Any clue as to what I'm doing wrong here?