码迷,mamicode.com
首页 > 其他好文 > 详细

星期取值

时间:2014-07-31 12:48:16      阅读:206      评论:0      收藏:0      [点我收藏+]

标签:blog   color   java   io   for   cti   ar   div   

weeknum = weekDay(now)
select case weeknum
 case "1"
  data="星期天"
 case "2"
  data="星期一"
 case "3"
  data="星期二"
 case "4"
  data="星期三"
 case "5"
  data="星期四"
 case "6"
  data="星期五"
 case "7"
  data="星期六"
 case else
  data="错误的时间"
end select




 <SCRIPT language=JavaScripta>
 today = new Date();
var hours = today.getHours();
var minutes = today.getMinutes();
var seconds = today.getSeconds();
var timeValue = "<FONT COLOR=#ffffff>" + ((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>

  

  

星期取值,布布扣,bubuko.com

星期取值

标签:blog   color   java   io   for   cti   ar   div   

原文地址:http://www.cnblogs.com/Gbeniot/p/3880290.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!