...

View Full Version : dynamic server time



G.A.
01-26-2005, 10:41 AM
Hi all,
i am trying to display a dynamic Clock at my pages, i want to display the server's time. i could do this by simply writing
<%= FormatDateTime(Now, 3)%><%= FormatDateTime(Date, 1) %>
but this displays a static time.
i found another way for displaying dynamic time,in fact a VBScript code, but this gives me the client's time.
how can i display the server's time dynamically?
regards,

glenngv
01-26-2005, 11:08 AM
http://www.codingforums.com/showthread.php?t=40589#post211835

G.A.
01-26-2005, 01:04 PM
thank you but could this be done on an ".shtm" not only ".asp"?

glenngv
01-27-2005, 02:35 AM
You cannot add server-side scripts in .stm, .shtm, or .shtml files. Those extensions are only set up for Server-Side Includes (SSI).

G.A.
01-27-2005, 07:37 AM
can i make a dynamic server time? in either extentions? i could only make a static server time by changing the file into .asp!

ghell
01-27-2005, 09:28 AM
just get a javascript clock script, and set it's original time (when the script is loaded) to the server's time

ie instead of
var datStartTime = ...clients time
increment every second and do other stuff like that

do
var datStartTime = <%=Time()%>;
increment every second and do other stuff like that

glenngv
01-27-2005, 01:19 PM
just get a javascript clock script, and set it's original time (when the script is loaded) to the server's time

ie instead of
var datStartTime = ...clients time
increment every second and do other stuff like that

do
var datStartTime = <%=Time()%>;
increment every second and do other stuff like that
That's essentially my suggestion in the link I posted.

G.A., is there any special reason behind your not using .asp extension? It's possible to make .htm files (or any extension for that matter) process asp scripts by mapping that extension to the asp.dll that handles execution of scripts. But why do that if you can already do it with .asp files?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum