js 获取当前时间
时间:2014-05-16 07:21:19
收藏:0
阅读:321
function getNowDate(){
var d = new Date();
var vYear =
d.getFullYear();
var vMon = d.getMonth() + 1;
var vDay =
d.getDate();
var h = d.getHours();
var m = d.getMinutes();
var
se = d.getSeconds();
s=vYear+(vMon<10 ? "0" + vMon : vMon)+(vDay<10
? "0"+ vDay : vDay)+(h<10 ? "0"+ h : h)+(m<10 ? "0" + m : m)+(se<10 ?
"0" +se : se);
return s;
}
评论(0)