Re: Count Down(How to find server date)

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



wrote on 29 aug 2008 in microsoft.public.scripting.jscript:

I have to make a count down program from of 22 october 2208. I did
it but it takes system date. it is running on website. suppose any
body change their system date then it shows countdown date on the
basis of current date. So how can it be possible that it should take
server date. It should not affected by sysetm date.

Try serverside programming.

Example in ASP-jscript,
disregarding possible summer time [dst] differences:

<script language = 'jscript' runat = 'server'>

var d2 = new Date(2208,10,22);
var d1 = new Date();

var dif = Math.floor((d2-d1)/864e5);

Response.write(dif + ' days, and counting ....');

</script>

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
.