随笔 - 299  文章 - 0  评论 - 0  阅读 - 6322 

编写一个显示当前时间的jsp页面

 

编写一个显示当前时间的jsp页面

代码:

复制代码
复制代码
 1 <%@ page  language="java" contentType="text/html; charset=utf-8"
 2     pageEncoding="utf-8"%>
 3 <%@page import="java.util.Date" %>
 4 <%@page import="java.text.SimpleDateFormat" %>
 5 <!DOCTYPE html>
 6 <html>
 7 <head>
 8 <meta charset="utf-8">
 9 <title>显示系统时间</title>
10 </head>
11 <body>
12     <%
13     Date date=new Date();
14     SimpleDateFormat df=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
15     String today=df.format(date);
16     %>
17     当前时间:<%=today %>
18 </body>
19 </html>
复制代码
复制代码

 

效果:

posted on   杨申龙  阅读(16)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· Manus的开源复刻OpenManus初探
· 三行代码完成国际化适配,妙~啊~
· .NET Core 中如何实现缓存的预热?
· 如何调用 DeepSeek 的自然语言处理 API 接口并集成到在线客服系统
点击右上角即可分享
微信分享提示