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

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -