View Full Version : Set Time zone
johnnelson001
01-16-2003, 07:44 PM
I want to set a timer so that at certain hours it will post a message. That I can do but I want it to do it in my time zone not the users how would you do that?:confused:
arnyinc
01-16-2003, 08:40 PM
Here's an edited function, mostly from http://tech.irt.org/articles/js076/index.htm
<SCRIPT LANGUAGE="JavaScript">
function getservertime(){
var youroffset = 5; //set this to YOUR gmt offset
var thetime=new Date();
timezoneoffset=thetime.getTimezoneOffset();
timezoneoffset=timezoneoffset * (-1);
thetime.setTime(thetime.getTime()+timezoneoffset*60*1000);
thetime.setTime(thetime.getTime()+youroffset*60*60*1000);
alert(thetime);
}
</script>
</HEAD>
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.