A
A
artshelom2017-04-10 16:54:49
Java
artshelom, 2017-04-10 16:54:49

Is it possible to convert a date in long format to another format in jsp??

Can this date be converted to the format: (day.month.year hour:minute)??

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nikolay Baranenko, 2017-04-10
@drno-reg

try like this

<%
long longvalue = ...;//например, значение из БД.
java.util.Date dateValue = new java.util.Date(longvalue);
pageContext.getSession().setAttribute("dateValue", dateValue);
%>
<fmt:formatDate value="${dateValue}" pattern="MM/dd/yyyy HH:mm"/>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question