I'm working on an history application so I need to cope with date before and after JC.
I'm trying to parse a string with the form "01/01/-200" but it returns a null date while it's working with "01/01/200".
Here is my code :
NSDateFormatter* dateFormatter = [[[NSDateFormatter alloc]init] autorelease];
[dateFormatter setDateFormat:@"dd/MM/y"]; // @TODO Get negative date
[dateFormatter setLenient:NO];
NSDate* date = [dateFormatter dateFromString:dateString];
return date;
I also try using with the form "01/01/200 BC" setDateFormat:@"dd/MM/y G"
but I can't make it work neither.
As mvds suggests in his answer, I tried the format "01/01/200 BC" on the simulator, and it's working... the problem only occurs on my iPad (version 3.2.1)
Do you have an idea how to do this properly ?