首页 > 代码库 > 星期取值
星期取值
weeknum = weekDay(now)select case weeknum case "1" data="http://www.mamicode.com/星期天" case "2" data="http://www.mamicode.com/星期一" case "3" data="http://www.mamicode.com/星期二" case "4" data="http://www.mamicode.com/星期三" case "5" data="http://www.mamicode.com/星期四" case "6" data="http://www.mamicode.com/星期五" case "7" data="http://www.mamicode.com/星期六" case else data="http://www.mamicode.com/错误的时间"end select
<SCRIPT language=JavaScripta> today = new Date();var hours = today.getHours();var minutes = today.getMinutes();var seconds = today.getSeconds();var timeValue = "http://www.mamicode.com/" + ((hours > 12) ? hours - 12 : hours);timeValue += ((minutes < 10) ? "<BLINK><FONT =#ffffff>:</FONT></BLINK>0": "<BLINK><FONT COLOR=#ffffff>:</FONT></black>") + minutes + "</FONT></FONT>";timeValue += (hours >= 12) ? "<FONT COLOR=#ffffff>PM</FONT>": "<FONT COLOR=#ffffff>AM</FONT>";function initArray() { this.length = initArray.arguments.length for (var i = 0; i < this.length; i++) this[i + 1] = initArray.arguments[i]}var d = new initArray("<font color=#ffffff>星期日", "<font color=#ffffff>星期一", "<font color=#ffffff>星期二", "<font color=#ffffff>星期三", "<font color=#ffffff>星期四", "<font color=#ffffff>星期五", "<font color=red>星期六");document.write("<font color=#ffffff>", today.getYear(), "<font color=#ffffff>年", "<font color=>", today.getMonth() + 1, "<font color=>月", "<font color=#ffffff>", today.getDate(), "<font color=#ffffff>日 </FONT>", d[today.getDay() + 1], " "); //--></SCRIPT>
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。