I have the following code in a windows storage application using c #
birthDateTimePicker.Date = DateTime.Now;
if (birthDateTimePicker.Date == DateTime.MinValue)
{
no_date_lable.Visibility = Visibility.Collapsed;
birthDateTimePicker.Visibility = Visibility.Collapsed;
}
Note: this line is birthDateTimePicker.Date = DateTime.Now; for example, the user will actually be selected or will come from the server.
But I get an exception on this line:
if (dt_born_dt == DateTime.MinValue)
What is the reason for the thrown exception:
The UTC time provided when applying the offset should be between year 0 and 10000.
Indeed, I tested this on three computers, and I got an error in one of them.
I changed my system time zone to (UTC-08: 00) Pacific Time (USA and Canada) and did not receive this exception at all, and the codes worked correctly!
, , (UTC + 03: 30) !
