refresh client side time and server side time

J

John Davis

This code will return the client's current time. But how to refresh the time
automatically?

<SCRIPT LANGUAGE=VBSCRIPT>
Document.Write Time
</SCRIPT>

What if I want to refresh the server's current time? Is this client side's
job or server side's job??
<%= Time %>

Thanks!
 
A

Adrian Forbes - MVP

But how to refresh the time automatically?

This is usually done with a java timer on the client if
you want it updated every second. Ask in a java group or
check the docs for the exact syntax.
What if I want to refresh the server's current time?

In the Window_onLoad event you can store the server's time
in a local variable;

dtTime = CDate("<%=Now%>")

Then set a timer up to fire every second which increments
this local variable by a second using DateAdd. Ask any
follow-ups in a client-script group.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top