I seem to be adding +11 minutes to my desired date values when I am converting them using NSDateFormatter.
The startDate and endDate as NSDates on MyObject, printed to the console:
START DATE: 2011-11-28 18:00:00 +0000
END DATE: 2011-11-28 20:00:00 +0000
My NSDateFormatter:
NSDateFormatter *formatter = [[[NSDateFormatter alloc] init] autorelease];
[formatter setDateFormat:@"hh:MM a"];
[formatter setTimeZone:[NSTimeZone timeZoneWithName:@"UTC"]];
Setting the dateRangeString:
NSString *dateRangeString = [NSString stringWithFormat:@"%@ - %@",
[formatter stringFromDate:self.startDate],
[formatter stringFromDate:self.endDate]];
The wrong resulting dateRangeString:
Date Range: 18:11 PM – 20:11 PM
Why is it adding an extra 11 minutes to the times? What am I doing incorrect in my conversion? Am I forgetting something silly? SO, please help my sanity!
MMis for months.
Formatting NSDate into particular styles for both year, month, day, and hour, minute, seconds