<SCRIPT LANGUAGE="JavaScript">
<!--
function Date.prototype.toString(){
return this.getFullYear()+"-"+(this.getMonth()+1)+"-"+this.getDate();
}
var d = new Date();
alert(d);
//-->
</SCRIPT>

解决方案 »

  1.   

    <SCRIPT LANGUAGE="JavaScript">
    <!--
    Date.prototype.format = function(format)
    {
      var o = {
        "M+" : this.getMonth()+1, //month
        "d+" : this.getDate(),    //day
        "h+" : this.getHours(),   //hour
        "m+" : this.getMinutes(), //minute
        "s+" : this.getSeconds(), //second
        "q+" : Math.floor((this.getMonth()+3)/3),  //quarter
        "S" : this.getMilliseconds() //millisecond
      } //author:meizz
      if(/(y+)/.test(format)) format=format.replace(RegExp.$1,
        (this.getFullYear()+"").substr(4 - RegExp.$1.length));
      for(var k in o)if(new RegExp("("+ k +")").test(format))
        format = format.replace(RegExp.$1,
          RegExp.$1.length==1 ? o[k] : 
            ("00"+ o[k]).substr((""+ o[k]).length));
      return format;
    };
    var d = new Date("Tue Apr 4 11:02:00 UTC+0800 2006");
    alert(d.format("yyyy-M-d"));
    alert(d.format("yyyy年MM月dd日hh时mm分ss秒"));
    //-->
    </SCRIPT>
      

  2.   

    谢谢====CSDN 小助手 V2.5 2005年11月05日发布====
    CSDN小助手是一款脱离浏览器也可以访问Csdn论坛的软件
    界面:http://blog.csdn.net/Qqwwee_Com/archive/2005/11/05/523395.aspx
    下载:http://szlawbook.com/csdnv2