ios - NSDate get all short days of the week? -
i need days of week in short mode, this:
sun,mon,etc ..
i have tried this:
nsdateformatter * df = [[nsdateformatter alloc] init]; [df setlocale:[[nslocale alloc] initwithlocaleidentifier:[[nslocale preferredlanguages] objectatindex:0]]]; [df setdateformat:@"c"];
which gives full names, how short ones?
nsdateformatter * formatter = [[nsdateformatter alloc] init]; nsarray * shortweeks = [formatter shortweekdaysymbols]; nslog(@"%@",shortweeks);
log
2015-07-14 17:25:31.470 newoctest[9016:286325] ( sun, mon, tue, wed, thu, fri, sat )
also,there veryshortweekdaysymbols
in dateformatter
nsdateformatter * formatter = [[nsdateformatter alloc] init]; nsarray * shortweeks = [formatter veryshortweekdaysymbols]; nslog(@"%@",shortweeks);
log
2015-07-14 17:30:30.686 newoctest[9073:290513] ( s, m, t, w, t, f, s )
Comments
Post a Comment