objective c - Get current NSDate with a format of: dd/MM/yyyy -


i'm trying current date following format: dd/mm/yyyy.

the way format it, this:

nsdateformatter *dateformat = [[nsdateformatter alloc] init]; [dateformat setdateformat:@"dd/mm/yyyy"]; 

and current date this: [nsdate date]. how can mix 2 together, , current date format?

if want current day format this: dd/mm/yyyy.

you can use code:

nsdate *datecenter = [nsdate date]; nsdateformatter *dateformat = [[nsdateformatter alloc] init]; [dateformat setdateformat:@"d, mmmm, yyyy"]; nsstring *datestring = [dateformat stringfromdate:datecenter]; lbldaymonthyear.text = datestring; 

Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -