在JavaScript中获取当前日期和时间
我有一个脚本,用JavaScript打印当前的日期和时间,但DATE总是错误的。这是代码:
var currentdate = new Date();
var datetime = "Last Sync: " + currentdate.getDay() + "/" + currentdate.getMonth()
+ "/" + currentdate.getFullYear() + " @ "
+ currentdate.getHours() + ":"
+ currentdate.getMinutes() + ":" + currentdate.getSeconds();
它应该打印18/04/2012 15:07:33和打印3/3/2012 15:07:33
有帮助吗?谢谢
BIG阳
aluckdog
相关分类