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

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -