Time and Date

What is the easiest way to display the computers time and date in a text box.

Thanks Shane.

dim d as new Date
textfield1.Text = d.ShortDate + " " + d.ShortTime

The date object is what you are looking for.

Link To Date Object Documentation.

Dim d As New Date TextField1.text = d.SQLDateTime

Thanks, what event do I put it in, in the textfield box.

Thanks Shane

Depends on what functionality or behavior you want. If you want the field to be initialized to the current date when the window opens, put it in the Open event of the field or the window. Otherwise, under what conditions do you want to load the field with the current date?

Thanks Tim, got it now.

Next question, how do you make the time update as the computer time changes, is there a way to do that.

Thanks Shane.

you could move the code into a Timer and set it’s frequency to as often as you require.
1000 = 1 second.