Jon Paal [MSMD] wrote on 14 mrt 2007 in
microsoft.public.inetserver.asp.general:
"Abs" <no**********@email.comwrote in message
>THis was working fine until i moved my site to a server based in the
states, not the time is 5hrs behind. Can anyone help me resolve
this??
[Please do not toppost on usenet]
ASP runs on the server and will return server time. If you want local
time of the user to be displayed on the page you can use client side
javascript .
However, it is quite possible to add
trusted [ ;-) ] serverside time precision to that:
==========================
<script runat=server language=javascript>
var ds = new Date();
ds = ds*1;
</script>
<script type='text/javascript'>
var ds = <% =ds %>; // numerical UTC server
var dc = new Date();
dc = dc*1; // numerical UTC client
var dif = ds-dc; // millisecs UTC difference
dif2 = Math.floor(-dif/1000)
document.write("Local clock error: " + dif2 + " sec.<br><br>");
d = new Date()
document.write("Client time being: " + d + "<br><br>");
d = new Date(d*1+dif);
document.write("Exact local time being: " + d );
</script>
============================
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)