DateFormat dateFormatterChina = DateFormat.getDateInstance();//格式化输出
TimeZone timeZoneChina = TimeZone.getTimeZone("Asia/Shanghai");//获取时区
dateFormatterChina.setTimeZone(timeZoneChina);//设置系统时区
Date date =new Date();//创建Data对象实例
String time= dateFormatterChina.format(date);
request.setAttribute("time", time);//放到request作用域中