首页 > 代码库 > javascript获取星期

javascript获取星期

入门:

var week = new Date().getDaty();

var ary = new Array("日","一","二","三","四","五","六");

var str = "星期" + ary[week];

 

进阶:

var str = "今天是星期" + "日一二三四五六".charAt(new Date().getDay());

javascript获取星期