ios - How can I get current month as number ie. "1" in objective c? -


this question has answer here:

how can current month not "jan" want in format "1", in short want current month as number because want append number string complete url link json parsing. thank in advance.


try month number

nsdate *date = [nsdate date]; nsdateformatter *datefor = [[nsdateformatter alloc]init]; [datefor setdateformat:@"mm"]; //[datefor setdateformat:@"m"]; // use single m avoid 0 before month number nsstring *monthnumber = [datefor stringfromdate:date]; 

hope help..


Comments

Popular posts from this blog

'hasOwnProperty' in javascript -

python - ValueError: No axis named 1 for object type <class 'pandas.core.series.Series'> -

Command prompt result in label. Python 2.7 -