I have two time pickers, one for Date, and one for time. Now I want to store the results in one DateTime object.
So I have a say 6/30/2004 12:00:00am date
and a 6/23/2004 3:33:00 am time, and I want
6/30/2004 3:33:00 am
Printable View
I have two time pickers, one for Date, and one for time. Now I want to store the results in one DateTime object.
So I have a say 6/30/2004 12:00:00am date
and a 6/23/2004 3:33:00 am time, and I want
6/30/2004 3:33:00 am
Ok, that is kind of silly, I have to append the Date to the Time Span.....
you could also try this:
VB Code:
Dim t1 As DateTime = Date.Parse("6/30/2004 12:00:00 am") Dim t2 As DateTime = Date.Parse("6/23/2004 3:33:00 am") Dim t3 As String = t1.Date.ToString Dim t4 As String = t2.TimeOfDay.ToString Dim t5 As DateTime = Date.Parse(t3 & t4) MessageBox.Show(t5)
I just used:
dtDateTime = DatePicker1.Value.Date.ToString & DatePicker2.Value.TimeOfDay.ToString