469,306 Members | 2,121 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,306 developers. It's quick & easy.

refresh client side time and server side time

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!

Jul 19 '05 #1
1 3069
> 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.
Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by Mark | last post: by
1 post views Thread by Marco Maroni | last post: by
4 posts views Thread by Jim Hammond | last post: by
7 posts views Thread by Bryan G | last post: by
32 posts views Thread by C. (http://symcbean.blogspot.com/) | last post: by
6 posts views Thread by Peter | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.