ios - NSDateFormatter cant parse German date -


i try make nsdateformatter set locale german, fails. in code below, while datefrom parsed, dateto not.

note: in german februar, not february.

nslocale *germanlocale = [[nslocale alloc] initwithlocaleidentifier:@"de_de"]; nsstring *formatstring = [nsdateformatter dateformatfromtemplate:@"dd. mmmm" options:0                                                           locale:germanlocale];  nsdateformatter *dateformat = [[nsdateformatter alloc] init]; [dateformat setdateformat:formatstring]; nsdate *datefrom = [dateformat datefromstring:@"20. september"]; nsdate *dateto = [dateformat datefromstring:@"20. februar"]; 

try setting locale of nsdateformatter:

nsdateformatter *dateformat = [[nsdateformatter alloc] init]; dateformat.locale = germanlocale; [dateformat setdateformat:@"dd. mmmm"]; nsdate *datefrom = [dateformat datefromstring:@"20. september"]; nsdate *dateto = [dateformat datefromstring:@"20. februar"]; 

Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -