I have a string of the format Jan 25, 2011 3:17 AM. I need to convert it to NSDate. I used NSDateFormatter with format @"MMM d, yyyy h:mm a". It Works well if iphone time is in 12 hr format, but returns nil if time is in 24 hr format. Can any one help me with this????
Capital H is used for 24 hour format. Don't 24 hour times usually exclude the AM/PM part? If so, your format string should be: @"MMM d yyyy H:mm"
.
Here's a reference for Unicode date format strings.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With