I just checked your provided code on my iOS 7.1 device and it gave me “3:22”, so the problem is not with the device or OS version.
The problem is locale, do it like this and it will work
- (NSString *)getLastTimeMessageWithPeriod:(NSDate *)lastMessageDate { NSDateFormatter *dateFormatter = [NSDateFormatter new]; [dateFormatter setDateFormat:@"h:mm a"]; [dateFormatter setLocale:[[NSLocale alloc] initWithLocaleIdentifier:@"en_US_POSIX"]]; return [dateFormatter stringFromDate:lastMessageDate];; }
source share