项目中用到的,记录一下。
代码如下:
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml" >
- <head>
- <title>JS农历测试</title>
- </head>
- <body>
- <script type="text/javascript" src="js/date_CTC.js" language="javascript"></script>
- <script type="text/javascript" language="javascript">CAL();</script>
- <br />
- <script type="text/javascript">
- var now = new Date();
- var str = now.getFullYear() + "年" + (now.getMonth() + 1) + "月" + now.getDate() + "日"
- var x = new Array("星期日", "星期一", "星期二");
- var xx = x.concat("星期三", "星期四", "星期五");
- var xx = x.concat("星期六");
- document.write(str+" "+x[now.getDay()]);
- </script>
- </body>
- </html>
源文件下载: 点击下载