时间函数整理

获取当前时间

function getdate() {
var now = new Date(),
y = now.getFullYear(),
m = now.getMonth() + 1,
d = now.getDate();
var dic={1:'一',2:'二',3:'三',4:'四',5:'五',6:'六',7:'日',}
return y + '年'+m+ '月' + d + '日 星期' + dic[now.getDay()];
}
原文地址:https://www.cnblogs.com/DonaldTrump/p/6723872.html