jsp输出当前时间

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

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

posted @ 2016-06-23 07:45  唐枫  阅读(1770)  评论(1编辑  收藏  举报