I tried to set the initial Date at UIDatePicker in Monotouch. The DatePicker always shows 1:05 in UIDatePickerMode.Time. If I do nothing it shows the current Time correctly.
Anybody can help me how to do this in Monotouch?
I tried to set the initial Date at UIDatePicker in Monotouch. The DatePicker always shows 1:05 in UIDatePickerMode.Time. If I do nothing it shows the current Time correctly.
Anybody can help me how to do this in Monotouch?
Are you setting up your NSDate corre correctly? This answer shows two ways to create a NSDate.
pick = new UIDatePicker (new RectangleF (0, 20, this.View.Bounds.Width, 10));
// Set NSDate:
DateTime date = DateTime.Parse("1981-07-01 22:21:00");
NSDate nsDate = DateTime.SpecifyKind(date, DateTimeKind.Utc);
// Get DateTime from NSDate:
date = DateTime.SpecifyKind(nsDate, DateTimeKind.Unspecified);
pick.Date = date;
pick.Mode = UIDatePickerMode.Time;