<%@ page language="java" import="java.util.*" pageEncoding="gb2312"%>
<html>
<head>
<title>显示时间</title>
</head>
<body>
<%
Date jnow = new Date();
int jhours = jnow.getHours();
int jminutes = jnow.getMinutes();
int jseconds = jnow.getSeconds();
out.print("服务器时间:"+ jhours + ":" + jminutes + ":" + jseconds);
%>
<script type="text/javascript">
var jsnow = new Date();
jshours = jsnow.getHours();
jsminutes = jsnow.getMinutes();
jsseconds = jsnow.getSeconds();
document.write("<br>浏览器时间:" + jshours + ":" + jsminutes + ":" + jsseconds);
</script>
</body>
</html>
<html>
<head>
<title>显示时间</title>
</head>
<body>
<%
Date jnow = new Date();
int jhours = jnow.getHours();
int jminutes = jnow.getMinutes();
int jseconds = jnow.getSeconds();
out.print("服务器时间:"+ jhours + ":" + jminutes + ":" + jseconds);
%>
<script type="text/javascript">
var jsnow = new Date();
jshours = jsnow.getHours();
jsminutes = jsnow.getMinutes();
jsseconds = jsnow.getSeconds();
document.write("<br>浏览器时间:" + jshours + ":" + jsminutes + ":" + jsseconds);
</script>
</body>
</html>