Home >Web Front-end >JS Tutorial >Use jstl tags in jsp pages to convert long timestamps
<strong>Code (reference)</strong>
##Backend:<strong></strong>
1. Import the java.util.Date class through <span style="color:#f33b45;"></span><pre class="brush:js;toolbar:false;"><%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %></pre>
2. Set the long time attribute value for the Date instance through <span style="color:#f33b45;"></span><pre class="brush:js;toolbar:false;"><jsp:useBean id="dateValue" class="java.util.Date"/>
<jsp:setProperty name="dateValue" property="time" value="${timestampValue}"/></pre>
3. Format Date instance through <span style="color:#f33b45;"></span><pre class="brush:js;toolbar:false;"><fmt:formatDate value="${dateValue}" pattern="MM/dd/yyyy HH:mm"/></pre>
Related articles:
The above is the detailed content of Use jstl tags in jsp pages to convert long timestamps. For more information, please follow other related articles on the PHP Chinese website!