date.js
上传用户:woden7206
上传日期:2015-11-28
资源大小:14486k
文件大小:1k
源码类别:

单片机开发

开发平台:

MultiPlatform

  1. today=new Date();                                                                              
  2. var hours = today.getHours();                                                                              
  3. var minutes = today.getMinutes();                                                                              
  4. var seconds = today.getSeconds();                                                                              
  5. var timeValue = "" + ((hours >12) ? hours -12 :hours); timeValue += ((minutes < 10) ? "<BLINK>:</FONT></BLINK>0" : "<BLINK>:</FONT></BLINK>") + minutes+"</FONT></FONT>";                                                                              
  6. timeValue += (hours >= 12) ? "  PM" : "AM";                                                                              
  7. function initArray(){                                                                              
  8. this.length=initArray.arguments.length                                                                              
  9. for(var i=0;i<this.length;i++)                                                                              
  10. this[i+1]=initArray.arguments[i]  }                                                                              
  11. var d=new initArray("星期日","星期一","星期二","星期三","星期四","星期五","星期六"); document.write("",today.getYear(),"年","",today.getMonth()+1,"月","",today.getDate(),"日 ",d[today.getDay()+1]," ",timeValue);