The visitTime attribute of POJO is date, and the date value in mybatis is 2015-01-09. When mapped to POJO, it will become the English date format.
There is a problem with the display of the page.
Sat Apr 28 00:00:00 CST 2018 |
DATE_FORMAT(
visit_time,
'%Y-%m-%d'
) AS visit_time
Still displayed in English.
2 Convert the date of pojo to string. Write a conversion method directly in POJO.
public String formateTime(Date date) {
SimpleDateFormat df=new SimpleDateFormat("yyyy-MM-dd");
return df.format(date);
}
Call it directly in EL:
${visit.formateTime(visit.visitTime) }
Sat Apr 28 00:00:00 CST 2018 |