代码如下:
<SCRIPT language=JavaScript>
today = <strong>new</strong> <strong>Date</strong>();
<strong>var</strong> date;
<strong>var</strong> centry ;
centry="";
<strong>if</strong> (today.<strong>getFullYear</strong>()<2000 )
centry = "19" ;
date1 = centry + (today.<strong>getFullYear</strong>()) + "年" + (today.<strong>getMonth</strong>() + 1 ) + "月" + today.<strong>getDate</strong>() + "日 " ;
date2 = "";
document.<strong>write</strong>( date1+date2);
</SCRIPT>
可以把上述代码放到网页任何地方