主题:建议:希望使用北京时间, -- 千僧
只要有一个时间换算的java script,在用户端虚拟机上运作主机没有负担。
function gettime () {
var weekd=new initArray("星期日","星期一","星期二","星期三","星期四", "星期五","星期六");
var now = new Date();
var offset = now.getTimezoneOffset()/60;
var chinaTime = now.getTime() + (8+offset) * 3600000;
now.setTime(chinaTime);
var day = now.getDate();
var week = now.getDay() + 1;
var month= now.getMonth() + 1;
var year= now.getYear();
var hours = now.getHours();
var minutes = now.getMinutes();
var seconds = now.getSeconds();
var timeValue = "北京时间: " + year + "年" + month + "月" + day + "日 ";
timeValue += weekd[week] + " ";
timeValue += ((hours < 10) ? " " : "") + hours;
timeValue += ((minutes < 10) ? ":0" : ":") + minutes
timeValue += ((seconds < 10) ? ":0" : ":") + seconds
}
- 相关回复 上下关系7
🙂建议:希望使用北京时间, 千僧 字144 2006-05-08 00:29:57
🙂这个时间的显示原则上是不会变动了。 铁手 字118 2006-05-08 22:51:08
🙂我的意思是统一用北京时间
🙂嗯,很好的SCRIPT。主要有两个问题 铁手 字296 2006-05-09 20:48:28
🙂这个script是在用户端执行的, 1 千僧 字142 2006-05-09 21:53:00
🙂或者能否使用脚本作一个转换 不是老陈 字58 2006-05-08 02:40:05
🙂可以修正java Script来实现的, 千僧 字44 2006-05-08 03:16:55