<script>
var d1=new Date("2005/02/28");
d1.setDate(d1.getDate()+1)
alert(d1);
</script>

解决方案 »

  1.   

    我用了你的方法﹐卻得到了Tue Mar 1 00:00:00 UTC+0800 2005
      

  2.   

    Date.prototype.dateAdd = function(n){
    return new Date(this.valueOf()+n*3600*24*1000);
    };
    var d1=new Date("2005/02/28");
    alert(d1.dateAdd(1))
      

  3.   

    <script language=javascript>
    function Date.prototype.toString(){
    if((this.getMonth()+1)<parseInt(10))
    {
    var Month0="0"+(this.getMonth()+1);
    }
    else
    {
    var Month0=this.getMonth()+1;
    }
    if((this.getDate())<parseInt(10))
    {
    var date0="0"+this.getDate();
    }
    else
    {
    var date0=this.getDate();
    }
    return this.getFullYear()+"/"+Month0+"/"+date0;
    } var d1=new Date("2005/02/28");
    d1.setDate(d1.getDate()+1)
    alert(d1);</script>
      

  4.   

    <script language="javascript">
    Date.prototype.Format = function(format)
    {
      var o = {
        "M+" : this.getMonth()+1, //month
        "d+" : this.getDate()+1,    //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;
    };
    alert(new Date().Format("yyyy-MM-dd"));
    </script>===============================
        CSDN小助手 是一款脱离浏览器也可以使用csdn论坛的
    软件!
        界面: http://qqwwee.com/
        下载: http://qqwwee.com/csdn.rar 包含源代码