Q:

Cannot get date from string

I have been trying to get NSDate from a string but it always result in nil.
 NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init];
 [dateFormat setDateFormat:@"yyyy-MMM-dd HH:mm:ss"];
 NSDate* date = [dateFormat dateFromString:string];

The string I am trying to parse is '2013-Nov-14 07:39:38'.
It seems I have been making a silly mistake. Any help is really appreciated.

A:

Thanks to Anna Karenina for hint.
Setting up my local to en_US worked for me.
NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init];
[dateFormat setDateFormat:@"yyyy-MMM-dd HH:mm:ss"];
NSLocale* locale = [[NSLocale alloc] initWithLocaleIdentifier:@"en_US"];
[dateFormat setLocale:locale];
NSDate* date = [dateFormat dateFromString:string];

This is working for me.

