|
-
Jun 23rd, 2004, 11:11 AM
#1
Thread Starter
Frenzied Member
How do I combine a date and a time (RESOLVED)
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
Last edited by SeanGrebey; Jun 23rd, 2004 at 11:20 AM.
Sean
Some days when I think about the next 30 years or so of my life I am going to spend writing code, I happily contemplate stepping off a curb in front of a fast moving bus.
-
Jun 23rd, 2004, 11:20 AM
#2
Thread Starter
Frenzied Member
Ok, that is kind of silly, I have to append the Date to the Time Span.....
Sean
Some days when I think about the next 30 years or so of my life I am going to spend writing code, I happily contemplate stepping off a curb in front of a fast moving bus.
-
Jun 23rd, 2004, 11:24 AM
#3
Hyperactive Member
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)
-
Jun 23rd, 2004, 11:28 AM
#4
Thread Starter
Frenzied Member
I just used:
dtDateTime = DatePicker1.Value.Date.ToString & DatePicker2.Value.TimeOfDay.ToString
Sean
Some days when I think about the next 30 years or so of my life I am going to spend writing code, I happily contemplate stepping off a curb in front of a fast moving bus.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|