I need to recognize date strings like Tue Aug 13 17:29:20 MSK 2013
. And, as I know, to do that I need to use 'V' symbol in NSDateFormmater, but it only recognizes GMT+04:00
like time zones. Is there any other way to parse time zone abbreviation?
Here is the code:
NSDateFormatter *dft = [[NSDateFormatter alloc] init];
[dft setDateFormat:@"EEE MMM dd HH:mm:ss V yyyy"];
NSLog(@"%@", [dft stringFromDate:[NSDate date]]);
NSLog(@"%@", [dft dateFromString:@"Tue Aug 13 17:29:20 MSK 2013"]);
Output:
Tue Aug 13 17:37:41 GMT+04:00 2013
(null)
With NSLog(@"%@", [dft dateFromString:@"Tue Aug 13 17:29:20 GMT+04.00 2013"])
output is fine.