javascript显示倒计时 能够适应不同时区。

<mce:script type="text/javascript"><!-- var d = new Date(); var tos = d.getTimezoneOffset() / 60; var currentday = "<?= $endTime ?>"; var test = new Date(currentday); var dayDiff = Math.floor((((test.getTime()-d.getTime())/60/60/1000)+tos-5)/24); var hourDiff = Math.floor(((test.getTime()-d.getTime())/60/60/1000+tos-5) - 24*dayDiff); dayDiff = dayDiff<0?0:dayDiff; // --></mce:script>

你可能感兴趣的:(javascript显示倒计时 能够适应不同时区。)