设置日期无效 var dd = new Date(2013,7,8); alert(dd); 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 var dd = new Date()dd.setFullYear(2013,7,8)document.write(dd) var d =new Date("2013,8,8").format('yyyy-MM-dd');alert(d );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}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;} 这样设置无效new Date(dtArr[0] + '-' + dtArr[1] + '-' + dtArr[2]); 这样才行 我不知道为什么 关于jquery中$.ajax调用问题?…… 手机浏览页面 js弹不出时间控件 HTML嵌入另外一个HTML的问题,被嵌入页面无法充满页面 【请教】非中文OS的HTML文件编码格式? substr函数为什么不可以用?!别人机器上正常使用,我的机器上返回为空的字符串!! 请教一个问题 类型转换问题``字符串转换成数字 请问在FireFoxz中如何取接点的第N个子元素? 客户端的 Script 有可能被关闭执行吗﹖ 如何在点击文件链接后均弹出文件下载框 div设置contentEditable="true"作为文本编辑器,定位光标解决办法,急求! toggle中的a标签问题
var dd = new Date()
dd.setFullYear(2013,7,8)
document.write(dd)
var d =new Date("2013,8,8").format('yyyy-MM-dd');
alert(d );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
}
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;
}