贴一个jsp接收到日期并进行日期格式化的demo,虽然简单,但还是老忘
<%List list=(List)request.getAttribute("blogs");
for(int i=0;i<list.size();i++){Blog blog=(Blog)list.get(i);
SimpleDateFormat sdf=new SimpleDateFormat("yyyy年MM月dd日");
String date=sdf.format(blog.getCreatedTime());
sdf=new SimpleDateFormat("HH:mm:ss");
String time=sdf.format(blog.getCreatedTime());
%>