I think I need to refine this, I am looking for a way to execute the date function from the server then apply the time value to some html file. Is this possible for vbscript to take the time from the server and apply it or will the browser always call the clients time???
Just make an sync xmlhttp request to a dedicated page on the server and get the response from it.
[1] On the client-side, make a handler
[tt]
function doit
surl="dedicated-page.asp"
set xmlhttp=createobject("msxml2.xmlhttp")
with xmlhttp
.open "get",surl & "?x=" & int(rnd*10000),false
.send
end with
if xmlhttp.status=200 then
sdata=xmlhttp.responsetext
else
sdata=""
end if
set xmlhttp=nothing
'you can now display sdata to some dedicated place on the page which contains the server date
'such as
'document.getElementById("xyz").value=sdata
'and you may need some formatting to make sdata presentable
end function
[/tt]
[2] And the dedicated-page.asp can be as simple as one liner.
<%
response.write now
%>
[3] You have to refine the above as it is air code. Furthermore, the error would be the time for transmitting the response.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.