js代码
<script type="text/javascript"> function startTime() { document.getElementById('beijing').innerHTML = calcTime(+8) document.getElementById('mengmai').innerHTML = calcTime(+5.5) document.getElementById('niuyue').innerHTML = calcTime(-5) document.getElementById('dongjing').innerHTML = calcTime(+9) document.getElementById('bali').innerHTML = calcTime(+2) document.getElementById('xini').innerHTML = calcTime(+10) t = setTimeout('startTime()', 1000) } function checkTime(i) { if (i < 10) { i = "0" + i } return i } function calcTime(offset) { var d = new Date(); var utc = d.getTime() + (d.getTimezoneOffset() * 60000); var nd = new Date(utc + (3600000 * offset)); var h = nd.getHours() var m = nd.getMinutes() var s = nd.getSeconds() h = checkTime(h) m = checkTime(m) s = checkTime(s) return h + ":" + m + ":" + s } </script>
在线预览
资源均来自第三方,谨慎下载,前往第三方网站下载