<%@ page import="java.util.Date" %><%--
Created by IntelliJ IDEA.
User:
Date: 2023/9/15
Time: 14:37
To change this template use File | Settings | File Templates.
--%>
<%@ page import="java.util.*" contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>$Title$</title>
</head>
<body>
<%
Date a = new Date();
int hours = a.getHours();
if(0<hours&hours<8){
out.print("清晨好");
}
if(hours>=8&&hours<=12){
out.print("早上好");
}
if(hours>12&&hours<=24){
out.print("下午好");
}
%>
</body>
</html>
jsp根据系统时间输出不同内容
最新推荐文章于 2024-07-10 21:37:49 发布