Monday, 26 August 2013

Converting date in milliseconds to date format using JSTL

Converting date in milliseconds to date format using JSTL

We can convert date in milliseconds to the normal date format using JSTL
as follows;
<jsp:useBean id="myDate" class="java.util.Date"/>
<c:set target="${myDate}" property="time" value="1365532200000"/>
<p>Date: ${myDate}</p>
output :
Tue Apr 09 18:30:00 GMT 2013
Consider, if my date in milliseconds is in GMT 5:30 time zone
(1365532200000+0530), how can I get the date in same time zone?

No comments:

Post a Comment