纯javascript取当前周几
var dayNames = new Array("星期天","星期一","星期二","星期三","星期四","星期五","星期六");
Stamp = new Date();
console.log(dayNames[Stamp.getDay()]);
执行结果:
时间: 2024-11-06 07:18:22
纯javascript取当前周几
var dayNames = new Array("星期天","星期一","星期二","星期三","星期四","星期五","星期六");
Stamp = new Date();
console.log(dayNames[Stamp.getDay()]);
执行结果: