I've found very strange bug of UIDatePicker in iOS4.
It seems that UIDatePicker timeZone is set during project build or something like this. You can reproduce it by setting
Code:
NSLog(@"Date : %@", [[NSDate date] description]);
datePicker.date = [NSDate date];
If you build it and run first time - all is ok. Then change your timezone to another and run it again (without cleaning targets) - in log you'll see correct date (according to new time zone) but in datePicker you'll see other date (from prev time zone). If you clean targets and rebuild it all is ok.
The workaround for this is to set current timezone to datePicker:
Code:
datePicker.timeZone = [NSTimeZone localTimeZone];
It's very strange behavior