ios - Change date format using NSDateFormatter -
i want use date format 2015-08-14
unfortunately getting format 16/11/15
below code have used desired output.
nsdateformatter *dateformatter = [[nsdateformatter alloc] init]; [dateformatter setdateformat:@"yyyy-mm-dd"]; nstimezone *gmt = [nstimezone timezonewithabbreviation:@"gmt"]; [dateformatter settimezone:gmt]; [dateformatter setdatestyle:kcfdateformattershortstyle]; nsstring *formatteddatestring = [dateformatter stringfromdate:selecteddate];
can please suggest how fix issue?
Comments
Post a Comment