I am getting an attribute/parameter from JSON response as EPOCH time variable.
I want to convert into dd/MM/yyyy hh:mm:ss
format and display in the table
<tbody>
<c:if
test="${not empty jsonResult && not empty jsonResult.records}">
<c:forEach items="${jsonResult.records}" var="record">
<tr>
<td style="width:15%;"><img src="${record.attributes.P_Image_Path}" class="img-responsive" /></td>
<td style="width:15%;">${record.attributes.P_Description}</td>
<td style="width:55%;">${record.attributes.P_Username_Seller}</td>
<%
java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("dd/MM/yyyy hh:mm:ss");
System.out.println(sdf.format( new java.util.Date(${record.attributes.P_Close_Time}));
%>
<td style="width:15%;">${record.attributes.P_Close_Time}</td>
</tr>
</c:forEach>
</c:if>
</tbody>
But it's unable to compile the JSP. I couldn't find how to use combination of scriplet and model attribute value from JSON
Update Tried this - not working
<c:set var="now" value="<%=new java.util.Date(${record.attributes.P_Close_Time}%>" />
<td style="width: 15%;"><fmt:formatDate pattern="dd/MM/yyyy hh:mm:ss" value="${now}" /></td>
Tried this - not working
<td style="width: 15%;"><fmt:formatDate pattern="dd/MM/yyyy hh:mm:ss" value="<%=new java.util.Date(${record.attributes.P_Close_Time})%>" /></td>
Tried this - not working
<td style="width: 15%;"><fmt:formatDate pattern="dd/MM/yyyy hh:mm:ss" value="<%=new java.util.Date(record.attributes.P_Close_Time)>" /></td>
you can use JSTL tags
http://www.tutorialspoint.com/jsp/jstl_format_formatdate_tag.htm