关于日期及日期格式转换的记录

第一种:Timestamp dateTime = new Timestamp(System.currentTimeMillis()); 

第二种:SimpleDateFormat format =  new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

        String d = format.format(dateTime);

        Date date=format.parse(d);

第三种:jsp中  <td style="text-align:center;" nowrap="nowrap"><fmt:formatDate value="${bean.lrsj}" pattern="yyyy-MM-dd HH:mm:ss"/></td>

posted on 2016-04-07 09:39  有酒有故事  阅读(154)  评论(0)    收藏  举报

导航