<strong>Code (reference)</strong>
##Backend:<strong></strong>
1. Import the java.util.Date class through <span style="color:#f33b45;"></span><div class="code" style="position:relative; padding:0px; margin:0px;"><pre class="brush:js;toolbar:false;"><%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %></pre><div class="contentsignin">Copy after login</div></div>
2. Set the long time attribute value for the Date instance through <span style="color:#f33b45;"></span><div class="code" style="position:relative; padding:0px; margin:0px;"><pre class="brush:js;toolbar:false;"><jsp:useBean id="dateValue" class="java.util.Date"/>
<jsp:setProperty name="dateValue" property="time" value="${timestampValue}"/></pre><div class="contentsignin">Copy after login</div></div>
3. Format Date instance through <span style="color:#f33b45;"></span><div class="code" style="position:relative; padding:0px; margin:0px;"><pre class="brush:js;toolbar:false;"><fmt:formatDate value="${dateValue}" pattern="MM/dd/yyyy HH:mm"/></pre><div class="contentsignin">Copy after login</div></div>
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!