非常急﹐日期的問題卡死我了﹐請求幫助 <script>var d1=new Date("2005/02/28");d1.setDate(d1.getDate()+1)alert(d1);</script> 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 我用了你的方法﹐卻得到了Tue Mar 1 00:00:00 UTC+0800 2005 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)) <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> <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 包含源代码 关于图片的预加载的问题 easyui datagrid选中一行然后填充表单 js如何多行只读? 正则表达式一个很简单的问题,不知道如何形容 求助网站图片单击效果的实现方式 关于onblure事件上,急啊! ie里元素打印位置问题 我的代码不稳定(有关.net和javascript )!请高手指教! 限制打开新窗口 在JSCRIPT中有没有关于对文件操作的函数,如C语言中的FILEOPEN。。。。 Google地图API大家在网页上用过没有?我研究了一下,果然很Cool firefox下的一个问题,请教大家!
return new Date(this.valueOf()+n*3600*24*1000);
};
var d1=new Date("2005/02/28");
alert(d1.dateAdd(1))
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>
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 包含源代码