I am displaying a date on jsp. Where i am setting the display format of the date as well. i.e (dd.MM.yyyy).
<%
SimpleDateFormat dateFormat = new SimpleDateFormat( "MM-dd-yyyy");
DatePoc myDate= DatePocLocalServiceUtil.fetchDatePoc(1);
%>
<html>
<div>
<h1><%=dateFormat.format(myDate.getCreateDate())%></h1>
</div>
</html>
Now i do not want to set the date format like this, it should be decided by the the user time zone. Suppose if user timezone is US/Canada the date format should be available with (MM.dd.yyyy) and if the user time zone is UK the display date should appear with (dd.MM.yyyy).