date.js
Upload User: woden7206
Upload Date: 2015-11-28
Package Size: 14486k
Code Size: 1k
Category:

SCM

Development Platform:

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);