当前位置:主页 > 软件编程 > JSP代码 >

jsp输出当前时间的实现代码

时间:2021-06-30 09:23:19 | 栏目:JSP代码 | 点击:

在jsp页面中输出完整的时间,格式为"年 月 日  时:分:秒"

 <% Date date = new Date(); 
  SimpleDateFormat t = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
  String time = t.format(date);
 %>
 当前时间:<%= time %>

您可能感兴趣的文章:

相关文章