jsp动态显示时间
来源:互联网 发布:mac原唱变伴奏 编辑:程序博客网 时间:2024/05/21 16:56
<head>
<base href="<%=basePath%>">
<title>My JSP 'MyJsp.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>
<script language="javascript">
function nowTime(ev,type){
/*
* ev:显示时间的元素
* type:时间显示模式.若传入12则为12小时制,不传入则为24小时制
*/
//年月日时分秒
var Y,M,D,W,H,I,S;
//月日时分秒为单位时前面补零
function fillZero(v){
if(v<10){v='0'+v;}
return v;
}
(function(){
var d=new Date();
var Week=['星期天','星期一','星期二','星期三','星期四','星期五','星期六'];
Y=d.getFullYear();
M=fillZero(d.getMonth()+1);
D=fillZero(d.getDate());
W=Week[d.getDay()];
H=fillZero(d.getHours());
I=fillZero(d.getMinutes());
S=fillZero(d.getSeconds());
//12小时制显示模式
if(type && type==12){
//若要显示更多时间类型诸如中午凌晨可在下面添加判断
if(H<=12){
H='上午'+H;
}else if(H>12 && H<24){
H-=12;
H='下午'+fillZero(H);
}else if(H==24){
H='下午00';
}
}
ev.innerHTML=Y+'年'+M+'月'+D+'日 '+''+W+''+H+':'+I+':'+S;
//每秒更新时间
setTimeout(arguments.callee,1000);
})();
}
</script>
<body onload="nowTime(nowtime,24);">
<p id="nowtime"></p>
</body>
</html>
<base href="<%=basePath%>">
<title>My JSP 'MyJsp.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>
<script language="javascript">
function nowTime(ev,type){
/*
* ev:显示时间的元素
* type:时间显示模式.若传入12则为12小时制,不传入则为24小时制
*/
//年月日时分秒
var Y,M,D,W,H,I,S;
//月日时分秒为单位时前面补零
function fillZero(v){
if(v<10){v='0'+v;}
return v;
}
(function(){
var d=new Date();
var Week=['星期天','星期一','星期二','星期三','星期四','星期五','星期六'];
Y=d.getFullYear();
M=fillZero(d.getMonth()+1);
D=fillZero(d.getDate());
W=Week[d.getDay()];
H=fillZero(d.getHours());
I=fillZero(d.getMinutes());
S=fillZero(d.getSeconds());
//12小时制显示模式
if(type && type==12){
//若要显示更多时间类型诸如中午凌晨可在下面添加判断
if(H<=12){
H='上午'+H;
}else if(H>12 && H<24){
H-=12;
H='下午'+fillZero(H);
}else if(H==24){
H='下午00';
}
}
ev.innerHTML=Y+'年'+M+'月'+D+'日 '+''+W+''+H+':'+I+':'+S;
//每秒更新时间
setTimeout(arguments.callee,1000);
})();
}
</script>
<body onload="nowTime(nowtime,24);">
<p id="nowtime"></p>
</body>
</html>
1 0
- jsp动态显示时间
- jsp页面显示动态时间
- JSP页面时间动态显示
- Jsp动态显示服务器时间
- jsp网页动态显示时间
- jsp页面动态显示时间
- JSP页面时间动态显示
- JSP页面时间动态显示
- jsp页面:动态显示时间
- jsp动态显示服务器时间 和 客户端显示时间
- jsp页面动态显示服务器时间
- 在JSP页面中显示动态时间
- jsp页面动态显示当前时间
- Jsp页面动态显示当前时间
- jsp动态显示系统时间页面
- jsp页面 动态显示时间 脚本
- JSP中实现动态显示系统时间
- 关于在jsp页面显示当前时间及动态显示
- LintCode 乱序字符串
- C++--内建类型所占的字节数与内建类型转换
- 创建视图和副本
- Minimum Depth of Binary Tree
- https 之 ssl 证书
- jsp动态显示时间
- 对于Objective-C新建类的理解
- Android开发工具ADT关联源码与API文档
- Spring中ApplicationContext和beanfactory区别
- 回归问题
- 指针的指针字符串排序
- Java语句——for循环
- 杂记&of python
- 一个shell字符串特殊字符处理的小函数