0

I am experimenting with NSDate and NSDateComponents and have a 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 it 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 I am retreiving an 11:00 time, but I am setting 14:00 at previous strings of code. How it can be?

4

0 に答える 0