User1160591469 posted
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?
Coding:
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)
============================
Error:
[FormatException: String was not recognized as a valid DateTime.]
============================