I'm having a hard time trying to convert a NSString to NSDate. I try lots of date format convinations, but no worked.
My string is: 5/17/2013 12:00:00 AM
And I'm using:
NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init];
[dateFormat setDateFormat:@"M/d/y hh:mm:ss a"];
[dateFormat setTimeZone:[NSTimeZone timeZoneWithName:@"GMT"]];
NSDate *cI = [dateFormat dateFromString:@"5/17/2013 2:00:00 AM"];
[dateFormat release];
I also try with:
- M/d/y h:mm:ss a
- M/d/y hh:mm:ss
- M/d/y h:mm:ss
But always cI is a nil.