I have following code for date and time in vb.net.
I am not able to set timer in the textbox 4 and 5.
What could be there in timer1 event?

        Dim theDate As Date
        theDate = Format(Now(), "short date")
        TextBox1.Text = theDate


        Dim mytime As System.DateTime
        Dim hours As Double = 2
        mytime = Now.ToShortTimeString


        TextBox2.Text = mytime
        Textbox3.Text = mytime.AddHours(+hours)

        Timer1.Start()

what is your expected output?

if you want to show date and time in textbox means?

Private Sub Form2_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
        Timer1.Enabled = True
End Sub
Private Sub Timer1_Tick(sender As System.Object, e As System.EventArgs) Handles Timer1.Tick
        TextBox4.Text = DateTime.Now.Date
        TextBox5.Text = DateTime.Now.TimeOfDay.ToString()
End Sub

i have set only date in textbox1 and system time in textbox2 and time 2 hrs later in textbox3.
So that if anyone want to change time , he can
I just want to start timer in textbox2 and 3

Private Sub Form2_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
        Timer1.Enabled = True
End Sub
Private Sub Timer1_Tick(sender As System.Object, e As System.EventArgs) Handles Timer1.Tick
        TextBox1.Text = DateTime.Now.Date
        TextBox2.Text = DateTime.Now.TimeOfDay.ToString()
        TextBox3.Text = DateTime.Now.AddHours(2).TimeOfDay
End Sub

Hope this will help you!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.