My code ,
-(NSString *)trimDateStringInRequiredFormat:(NSString *)dateInString{ NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; [dateFor
try doing:
[dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
With hh you have the 12h format, with HH you use 24h format
This is because for 24 Hr format you need to use HH instead of hh