iphone - How To convert int into NSDate format? -
i have taken 2 values 140 & 200 , if add 140+200 = 340 want output of 340 days nsdate format
nscalendar *calendar = [[[nscalendar alloc] initwithcalendaridentifier:nsgregoriancalendar] autorelease]; nsdatecomponents *components = [[[nsdatecomponents alloc] init] autorelease]; [components setday:340]; nsdate *date = [calendar datefromcomponents:components]; gives date 340s day of year 0... long ago.
Comments
Post a Comment