date.js
上传用户:jisenq
上传日期:2014-06-29
资源大小:7216k
文件大小:1k
源码类别:

数据库编程

开发平台:

ASP/ASPX

  1. var day="";
  2. var month="";
  3. var ampm="";
  4. var ampmhour="";
  5. var myweekday="";
  6. var year="";
  7. mydate=new Date();
  8. myweekday=mydate.getDay();
  9. mymonth=mydate.getMonth()+1;
  10. myday= mydate.getDate();
  11. myyear= mydate.getYear();
  12. year=(myyear > 200) ? myyear : 1900 + myyear;
  13. if(myweekday == 0)
  14. weekday=" 星期日 ";
  15. else if(myweekday == 1)
  16. weekday=" 星期一 ";
  17. else if(myweekday == 2)
  18. weekday=" 星期二 ";
  19. else if(myweekday == 3)
  20. weekday=" 星期三 ";
  21. else if(myweekday == 4)
  22. weekday=" 星期四 ";
  23. else if(myweekday == 5)
  24. weekday=" 星期五 ";
  25. else if(myweekday == 6)
  26. weekday=" 星期六 ";
  27. document.write(year+"年"+mymonth+"月"+myday+"日 "+weekday);