JSP中将datetime字段年月日后的时分秒不显示
DUptime为datetime字段:ListlistTime=newArrayList();Stringsql5="SELECTDUptimeFROMdoctable1...
DUptime为datetime字段:
List listTime=new ArrayList();
String sql5="SELECT DUptime FROM doctable1 AS STRDATE WHERE DNumber='"+docString+"'";
listTime=a.executeQuery(sql5);
String uptime = listTime.get(0).toString();
……
<td width="30%">
<div align="left">上传时间:<%= uptime%></div></td>
就是时分秒不显示 展开
List listTime=new ArrayList();
String sql5="SELECT DUptime FROM doctable1 AS STRDATE WHERE DNumber='"+docString+"'";
listTime=a.executeQuery(sql5);
String uptime = listTime.get(0).toString();
……
<td width="30%">
<div align="left">上传时间:<%= uptime%></div></td>
就是时分秒不显示 展开
3个回答
展开全部
利用javascript
<script language=JavaScript>
today=new Date();
function initArray(){
this.length=initArray.arguments.length
for(var i=0;i<this.length;i++)
this[i+1]=initArray.arguments[i] }
var d=new initArray(
"星期日",
"星期一",
"星期二",
"星期三",
"星期四",
"星期五",
"星期六");
document.write(
"<font color=##000000 style='font-size:9pt;font-family: 幼圆'> ",
today.getYear(),"年",
today.getMonth()+1,"月",
today.getDate(),"日 ",
d[today.getDay()+1],
"</font>" );
</script>
<script language=JavaScript>
today=new Date();
function initArray(){
this.length=initArray.arguments.length
for(var i=0;i<this.length;i++)
this[i+1]=initArray.arguments[i] }
var d=new initArray(
"星期日",
"星期一",
"星期二",
"星期三",
"星期四",
"星期五",
"星期六");
document.write(
"<font color=##000000 style='font-size:9pt;font-family: 幼圆'> ",
today.getYear(),"年",
today.getMonth()+1,"月",
today.getDate(),"日 ",
d[today.getDay()+1],
"</font>" );
</script>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询