Jsp page time display year month day (decode usage)

Sometimes the page display time needs to display the year, month and day. I will introduce two methods for converting the format (for oracle).

1. Direct conversion of sql statements

select to_char(t.time,'yyyy')||decode(t.time,null,'','年')||to_char(t.time,'mm')||decode(t.time,null,'','月')||to_char(t.time,'dd')||decode(t.time,null,'','日') from table t;

 

2. jstl tags

<fmt:formatDate value="${data}" pattern="yyyy年MM月dd日"/>

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326853652&siteId=291194637
Recommended