jsp页面时间显示格式

方法1:使用 Struts2中的标签

 

方法2:或者在插入数据库时进行转换格式

    Date currentTime = new Date();
    SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    String dateString = formatter.format(currentTime);

你可能感兴趣的:(java,jsp,date,struts,string,数据库)