ios - How can I get current month as number ie. "1" in objective c? -
this question has answer here:
- nsdate year/month/day 17 answers
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
Post a Comment