Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: Set Time zone

  1. #1
    New to the CF scene
    Join Date
    Jan 2003
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Set Time zone

    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?

  • #2
    Regular Coder
    Join Date
    Jan 2003
    Posts
    867
    Thanks
    4
    Thanked 8 Times in 8 Posts
    Here's an edited function, mostly from http://tech.irt.org/articles/js076/index.htm

    Code:
    <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>


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •