I am trying to set the format for a given dateString but I am not able to get it working. Here is the code I am using:
[dateFormatter setDateFormat:@”yyyy-MM-dd hh:mm:ss”];
date = [dateFormatter dateFromString:@”2011-05-08 18:31:42″];
but I keep getting (null) for the date,
Any help would be appreciated.
hhshould beHH.hhis for 12-hour time andHHis 24-hour time. Here’s your code with the changes: