Reputation: 27
I am using a DatePicker
to select a date entered by the user.
The settings for my DatePicker
are:
However it always added 3 hours to the date selected by the user
MyItem.limitTime = DatePickerLimitTime.Value;
How to solve this problem?
Upvotes: 0
Views: 586
Reputation: 1109
Use NSDateFormatter
to format your date before printing it, also set correct TimeZone
myDatePicker.TimeZone = NSTimeZone.LocalTimeZone;
myDatePicker.ValueChanged += (sender, e) =>
{
lbl.Text = NSDateFormatter.ToLocalizedString(myDatePicker.Date, NSDateFormatterStyle.Full, NSDateFormatterStyle.Medium);
};
Upvotes: 1