Hi everyone,
I am a beginner at javascript, and I'm having some troubles with a script I'm trying to use.
I downloaded a countdown script which works great... however, it's using the user's time on their computer to reference the countdown, but I need everyone's countdown to be the same, even if their computer's clock is a little off, or if they are in a different time zone.
I need to know how to use the SERVER's clock instead of the user's clock - is there a way? Here is the code I am currently using:
var today=new Date()
var todayy=today.getYear()
if (todayy < 1000)
todayy+=1900
var todaym=today.getMonth()
var todayd=today.getDate()
var todayh=today.getHours()
var todaymin=today.getMinutes()
var todaysec=today.getSeconds()
var todaystring=montharray[todaym]+" "+todayd+", "+todayy+" "+todayh+":"+todaymin+":"+todaysec
futurestring=montharray[mo-1]+" "+da+", "+yr+" "+hr+":"+minute+":"+sec
Is there an easy way to do this?
Thanks in Advance!!!
I am a beginner at javascript, and I'm having some troubles with a script I'm trying to use.
I downloaded a countdown script which works great... however, it's using the user's time on their computer to reference the countdown, but I need everyone's countdown to be the same, even if their computer's clock is a little off, or if they are in a different time zone.
I need to know how to use the SERVER's clock instead of the user's clock - is there a way? Here is the code I am currently using:
var today=new Date()
var todayy=today.getYear()
if (todayy < 1000)
todayy+=1900
var todaym=today.getMonth()
var todayd=today.getDate()
var todayh=today.getHours()
var todaymin=today.getMinutes()
var todaysec=today.getSeconds()
var todaystring=montharray[todaym]+" "+todayd+", "+todayy+" "+todayh+":"+todaymin+":"+todaysec
futurestring=montharray[mo-1]+" "+da+", "+yr+" "+hr+":"+minute+":"+sec
Is there an easy way to do this?
Thanks in Advance!!!