view server time

J

john

Is it possible to display the current time directly from the server,
and not client-side...I have people in different time zones trying to
view the same page and the times (based on client) are coming up
different.

Thanks.
 
E

Evertjan.

john wrote on 02 sep 2003 in comp.lang.javascript:
Is it possible to display the current time directly from the server,
and not client-side...I have people in different time zones trying to
view the same page and the times (based on client) are coming up
different.

1 by serverside code (ASP: Time is <%=now%> )

2 by "GET"-ing the header:

<script type="text/javascript">
var xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
xmlhttp.open("GET", "http://www.qwerty.com/", false);
xmlhttp.send();
alert(xmlhttp.getAllResponseHeaders().replace(/^(.*)[\s\S]*/,"$1"));
</script>
 

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

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top