The date format can be set globally with setting culture information like:
Nullable<DateTime> dtDate = new DateTime();
System.Globalization.CultureInfo enGB = new System.Globalization.CultureInfo("en-GB");
dtDate = Convert.ToDateTime(txtDate.Text, enGB);
NOTE: txtDate is textBox or it can be any control like datepicker or calander.
Thanks
No comments:
Post a Comment