jsp formatting process to date

Original link: https://www.cnblogs.com/haoxiu1004/p/7677976.html

1, when the background pass over time format data type is the time, this time can be processed directly

     <fmt:formatDate value="${blog.releaseDate }" type="date" pattern="yyyy-MM-dd HH:mm"/>

 

2, when the backstage pass over the time format is String time, this time we must use indirect process:

     <fmt:parseDate var="dateObj" value="${lists.request_time}" type="DATE" pattern="yyyy-MM-dd HH:ss:mm"/>

<fmt:formatDate var="reTime" value='${dateObj}' pattern='yyyy-MM-dd HH:ss:mm' />

${reTime}

Guess you like

Origin blog.csdn.net/luo_yu_1106/article/details/90603383