I have the following code. When I run it on my iOS 3.1.3 device (get over it!) it works as expected, but when I run it on the simulator (iOS 5 and 4.3) it is 1 minute and 15 seconds off (9:01:15). Is this because of my code, a bug in the simulator or a bug in iOS 4+?
NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];
NSDateComponents *components = [calendar components:(NSHourCalendarUnit | NSMinuteCalendarUnit) fromDate:[NSDate date]];
components.hour = 9;
components.minute = 0;
NSDate *date = [calendar dateFromComponents:components]; // <-- date is off on simulator
Thanks for your help!