javascript获取时区



你好,我用Javascript编写了这段代码,但我想更改时区GMT1 GMT2,但我找不到必须在哪里进行更改,也许可以帮助我?

<script type="text/javascript">
$(document).ready(function() {
    setInterval( function() {
        var seconds = new Date().getSeconds();
        var sdegree = seconds * 6;
        var srotate = "rotate(" + sdegree + "deg)";
        $("#sec_rus").css({"-moz-transform" : srotate, "-webkit-transform" : srotate});
    }, 1000 );

    setInterval( function() {
        var hours = new Date().getHours();
        var mins = new Date().getMinutes();
        var hdegree = hours * 30 + (mins / 2);
        var hrotate = "rotate(" + hdegree + "deg)";
        $("#hour_rus").css({"-moz-transform" : hrotate, "-webkit-transform" : hrotate});
    }, 1000 );

    setInterval( function() {
        var mins = new Date().getMinutes();
        var mdegree = mins * 6;
        var mrotate = "rotate(" + mdegree + "deg)";
        $("#min_rus").css({"-moz-transform" : mrotate, "-webkit-transform" : mrotate});
    }, 1000 );
}); 
</script>

您可以尝试var hours = new Date.getUTCHours() + 2;

相关内容

  • 没有找到相关文章

最新更新