[JSP]获取时间

<%@ page contentType="text/html;charset=gb2312" %>
<%@ page import="java.util.*"%>
<html><head><title>ex5-5.jsp</title></head>
<body>
<h1>
<br>
<center>
<%
    Date Nowdate = new Date();
    String nowhour = String.valueOf(Nowdate.getHours());
    String nowmin = String.valueOf(Nowdate.getMinutes());
    String nowsec = String.valueOf(Nowdate.getSeconds());
    
%>
如今是北京时间:
<%out.print(nowhour);%><%out.print(nowmin);%><%out.print(nowsec);%></center></h1></body>
</html> 
    
相关文章
相关标签/搜索