Hi,
I want to display the system Date & time to my website.
How is this possible?
Printable View
Hi,
I want to display the system Date & time to my website.
How is this possible?
Copy the declarations and code below and paste directly into your VB project.
I hope this is what you are looking for!Code:<HTML>
<HEAD>
<TITLE>My Web Page</TITLE>
</HEAD>
<BODY>
Welcome to my web page. The current time is <%= Time() %>
on <%= Date() %>.
</BODY>
</HTML>
The timer is the right solution. But only in client/server environment. I did this also in WEB forms and the timer caused changes in the form - the cursor jumps after the timer event automaitacally on the first item of the form because of refreshing the form. Also the docs say there will be to much trafic to the Forms server.
Try this code:
Code:Private Sub Form_Load()
' run every half second
Timer1.Interval = 500
End Sub
Private Sub Timer1_Timer()
txtTime.Text = Time
txtDate.Text = Date
End Sub