<body>
<input id="t1"/>
<input id="t2"/>
<script>
Date.prototype.toBeginTime = function(){
return this.getFullYear() + "-" + parseInt(this.getMonth()+1) + "-" + this.getDate() + " " + "00:00:00";
}
Date.prototype.toEndTime = function(){
return this.getFullYear() + "-" + parseInt(this.getMonth()+1) + "-" + this.getDate() + " " + "23:59:59";
}
document.all.t1.value = new Date().toBeginTime();
document.all.t2.value = new Date().toEndTime();
</script>
</body>
<input id="t1"/>
<input id="t2"/>
<script>
Date.prototype.toBeginTime = function(){
return this.getFullYear() + "-" + parseInt(this.getMonth()+1) + "-" + this.getDate() + " " + "00:00:00";
}
Date.prototype.toEndTime = function(){
return this.getFullYear() + "-" + parseInt(this.getMonth()+1) + "-" + this.getDate() + " " + "23:59:59";
}
document.all.t1.value = new Date().toBeginTime();
document.all.t2.value = new Date().toEndTime();
</script>
</body>
解决方案 »
- JavaScript不支持IE6,请高手帮忙看看,thank you
- 我想写个类似于QQ的一个聊天工具,请问那个上面的字体怎么加上去?
- js W3C标准 兼容问题!
- 从access数据库读取字段,加入到javascript中?
- 求教:是否在跨域情况下,$.ajax中的async=false是否会失效?
- 求一正则表达式,正则高手看看,小弟求救!
- 一个关于freemarker的问题。
- 急.......非常简单的问题
- 关于js的嵌套,有可能实现吗?高手来帮~~~~~
- 谁有关于“正则表达式”的资源,大家共享一下好吗?
- parseInt(90)/60得到的是1.5,我怎么样得到为1 ??
- 请问如何判断往text框里输入的是空格键???
import java.text.*;
<%
Date now = new Date();
DateFormat df = DateFormat.getDateInstance();
String s = df.format(now);
String s_begin=s+" 00:00:00";
String s_end=s+" 12:59:59";
%>
<input type="text" value="<%=s_begin%>" />
<input type="text" value="<%=s_end%>" />