header('content-type:text/html;charset=gbk');
date_default_timezone_set('PRC');
$n=chr(13);
echo "
echo "document.write('
?
');".$n;
echo "var y=".date("Y")."; //年 ".$n;
echo "var m=".date("n")."; //月 ".$n;
echo "var d=".date("j")."; //日 ".$n;
echo "var w=".date("w")."; //星 ".$n;
echo "var h=".date("H")."; //时 ".$n;
echo "var i=".date("i")."; //分 ".$n;
echo "var s=".date("s")."; //秒 ".$n;
echo "var hstr=istr=sstr=a='';".$n;
echo "var ww = Array('日','一','二','三','四','五','六');".$n;
echo "function clock(){".$n;
echo " s++;".$n;
echo " if (s==60) {i+=1;s=0;}//秒进位".$n;
echo " if (i==60) {h+=1;i=0;}//分进位".$n;
echo " if (h==24) {w+=1;d+=1;h=0;}//时进位".$n;
echo " if (w==7) {w=0;}//星期进位".$n;
echo " if (m==2) { //是否是二月份?".$n;
echo " if (!y%4>0) { //不是闰月(二月有28天)".$n;
echo " if (d==30){".$n;
echo " m+=1;".$n;
echo " d=1;}".$n;
echo " }".$n;
echo " else { //是闰月(二月有29天)".$n;
echo " if (d==29){".$n;
echo " m+=1;".$n;
echo " d=1;}".$n;
echo " }".$n;
echo " }".$n;
echo " else { //非2月份的月份".$n;
echo " if (m==4 || m==6 || m==9 || m==11) { //只有30天的月份".$n;
echo " if (d==31) {".$n;
echo " m+=1;".$n;
echo " d=1;}".$n;
echo " }".$n;
echo " else { //有31天的月份".$n;
echo " if (d==32){".$n;
echo " m+=1;".$n;
echo " d=1;}".$n;
echo " }".$n;
echo " }".$n;
echo " if (m==13) {y+=1;m=1;}//月进位".$n;
echo " if (h < 10) {hstr&#61;&#39; 0&#39;&#43;h} else {hstr&#61;&#39; &#39;&#43;h};".$n;
echo " if (i < 10) {istr&#61;&#39;:0&#39;&#43;i} else {istr&#61;&#39;:&#39;&#43;i};".$n;
echo " if (s < 10) {sstr&#61;&#39;:0&#39;&#43;s} else {sstr&#61;&#39;:&#39;&#43;s};".$n;
echo " if (h < 13) {astr&#61;&#39; am&#39;;} else {astr&#61;&#39; pm&#39;;};".$n;
echo " TimeShow.innerHTML&#61;y&#43;&#39;年&#39;&#43;m&#43;&#39;月&#39;&#43;d&#43;&#39;日 &#39;&#43;&#39;星期&#39;&#43;ww[w]&#43;&#39;&#39;&#43;hstr&#43;istr&#43;sstr&#43;astr;".$n;
echo " setTimeout(&#39;clock()&#39;,1000);".$n;
echo "}".$n;
echo "clock();".$n;
echo "".$n;
?>