Last post Oct 07, 2016 01:36 AM by Eric Du
Oct 05, 2016 07:24 AM|NurulShaf|LINK
I'm creating a webform which have 1 textbox(TextBox1) for Date that gets the date value from a calendar control, and 3 dropdownlists control for hour(timeHour), minute(timeMin) and am/pm(timeIn). I tried using DateTime.Parse method but it didnt work. Can
anybody please help point out my mistake?
Dim dDate As Date = TextBox1.Text
Dim dt As Date = DateTime.Parse(timeInHour.SelectedValue.Trim() + ":" + timeInMin.SelectedValue.Trim() + ":00 " + timeIn.SelectedValue)
Dim dTime As Date = dt
Dim d As New Date(dDate.Year, dDate.Month, dDate.Day, dTime.Hour, dTime.Minute, dTime.Second, DateTimeKind.Local)
[FormatException: String was not recognized as a valid DateTime.]
Oct 05, 2016 07:29 AM|NurulShaf|LINK
Oops sorry. Don't bother this question. I just re-run the page and it suddenly works >.<
Oct 07, 2016 01:36 AM|Eric Du|LINK
Glad to hear your question has been resolved, please mark your reply to the answer!