ios - Different dates as result when converting from NSDateComponents to NSDate -
i experimenting nsdate
, nsdatecomponents
, have code:
... nsdatecomponents *newcomponents = [[nsdatecomponents alloc] init]; [newcomponents setyear:from_year]; [newcomponents setmonth:from_month]; [newcomponents setday:from_day]; [newcomponents sethour:from_hour]; [newcomponents setminute:from_min]; nslog(@"newcomponents - %@", newcomponents); nsdate *newdatefrom = [calendar datefromcomponents:newcomponents];// here is! nslog(@"newdatefrom - %@", [newdatefrom description]); ...
and appropriate log of used nslog
's:
newcomponents - calendar year: 2013 month: 9 day: 3 hour: 14 minute: 0
newdatefrom - 2013-09-03 11:00:00 +0000
so, somehow retreiving 11:00 time, setting 14:00 @ previous strings of code. how can be?
Comments
Post a Comment